Manually Downloading and Installing Packages in R

I also went through the same problem while installing caret package, There are many dependencies of caret package. So ,I did the following

install.packages('caret') This gives all packages in zip format the location of download is shown in the error message. Unzip all packages from download source to a location for example in 'C:/PublicData/RawRPackages' , then run following command.

foldername<-'C:/PublicData/RawRPackages'
install.packages(paste(foldername , 'caret',sep='/'), repos = NULL, type="source")
library(caret, lib.loc=foldername)

this the better way, if we want to download and install locally :

download.packages('lib_name',destdir='dest_path')

for example :

download.packages('RJDBC',destdir='d:/rlibs')

You can install the package manually using the following command

install.packages('package.zip', lib='destination_directory',repos = NULL)

See the help of ?install.packages, for further description

Tags:

R