Installing R Add On Packages without CRAN [duplica

2019-08-15 10:57发布

This question already has an answer here:

I am posting this question after reading and attempting the suggestions mentioned at :-

Offline install of R package and dependencies

I am looking to create a Local package repository for installing tar.gz packages in a Linux R server instance .

I have followed the instructions exactly as mentioned in this post :-

Step 1 - Downloaded all R packages to the source destination on Linux. 

Step 2 - Used library(tools) write_PACKAGES("/path/to/packages/") This created 2 files in /path/to/packages/ :- PACKAGES and PACKAGES.GZ 

Step 3 - Launched R (v 3.2.0) and ran this command :- install.packages("ggplot2", contrib.url="file:///path/to/packages/")

However, the CRAN Menu (which prompts for selecting a CRAN mirror) pops up. I was under the impression that it will not. When I proceed to select a repository and hit Okay,I get the following error message :-

Error in download.file(url, destfile, method, mode = "wb", ...) : unused argument (contrib.url = "path/to/packages/")

Can someone, please help.

标签: linux r
1条回答
迷人小祖宗
2楼-- · 2019-08-15 11:28

From the help of install.packages (which you can access using ?install.packages) you can see that the correct argument name is contriburl without the dot.

Apparently you should use it as:

contriburl = contrib.url("file:///pathToYourFiles/")
查看更多
登录 后发表回答