Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R package from local drive

Tags:

r

I don't have access to internet. Hence, i downloaded sqldf package from other system and then transfer it to this system.

The sqldf_0.4-10.tar file is saved in "C:\Users\Riya\Documents\R" and also saved binary file in the same folder. I want to install the package with dependencies as well. When i am installing the package using "Install Package from local zip file" under "Packages" dropwdown. It is not installing dependencies. I googled solutions and found :

tools::write_PACKAGES("C:/Users/Riya/Documents/R/") 

After that,

install.packages("sqldf", repos="file://C:/Users/Riya/Documents/R/") 

It is giving me an error -

source repository is unavailable to check versions 
Error in read.dcf(file = tmpf) : cannot open the connection 
In addition: Warning message: 
In read.dcf(file = tmpf) : 
cannot open compressed file '//C:/Users/Riya/Documents/R/bin/windows/contrib/3.1/PACKAGES', probable reason 'No such file or directory'> 

It's a window system. Note : tools::write_PACKAGES() creates 2 files. I also deleted "PACKAGES.gz" file as per the solution mentioned in a forum.

like image 855
Riya Avatar asked Nov 28 '25 23:11

Riya


1 Answers

From the R console you can go with:

install.packages("C:/Users/Riya/Documents/R/sqldf_0.4-10.tar", repos=NULL, type="source")

You can also install from OS command line, using R CMD INSTALL as G. Grothendieck wrote in the comment.

like image 81
jangorecki Avatar answered Nov 30 '25 13:11

jangorecki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!