1

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.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
rantish
  • 79
  • 1
  • 8
  • 1
    a) It is called CRAN, not CRANE. Edited in three places. b) This has been asked and answered several times. c) For local installs you do NOT need a local repo. Point to files directly. d) Look at [drat](http://dirk.eddelbuettel.com/code/drat.html) for easy local repos if you think you need one. – Dirk Eddelbuettel May 13 '15 at 13:09

1 Answers1

1

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/")
nico
  • 50,859
  • 17
  • 87
  • 112
  • Thank you so much Nico - install.packages("ggplot2", contriburl = (contrib.url="file:///pathToYourFiles/")) did the trick . – rantish May 13 '15 at 13:32