tags:

views:

137

answers:

3

I would like to create a local R package repository such that users in my company can install packages from it and the system admins can update the local repo periodically. Access to the CRAN mirrors is currently denied.

Is there a simple way to do this?

Thank you for your time.

EDIT: I apologize for the oversight. The guide is where I should have looked first. Thank you.

+3  A: 

Yes, either a copy of CRAN or a repo with local packages is easy to set up. Presumably you want this for Windows so do this:

  1. Create a top-level directory on your webserver, say R/
  2. Create the usual hierarchy in there: R/bin/windows/contrib/2.11. If you need to support other (earlier) releases, simply create directories 2.10, 2.9, ... next to the 2.11 directory.
  3. Place the packages you need into the directory (say, 2.11), then change into that directory and run

    tools::write_PACKAGES(".", type="win.binary")

That is all there is to it -- now you can access the repository by pointing to the address given a command such as

update.packages(repos="http://my.local.server/R", ask=FALSE)

which I even do in R/zzz.R for local packages so that they update themselves.

Dirk Eddelbuettel
+7  A: 

Read the section of the Administrator guide.

Shane
+1 for pointer to Reading The Fine Manuals (TMP)
Dirk Eddelbuettel
A: 

You can always download packages from CRAN, hence install them through network...

install.packages("path-to-package", repos = NULL, type = "source")
aL3xa