Personal CRAN-repository

Offering – the backbone of open source. The image is CC by TenthMusePhotography

This is part II of the previous package creation post. I’ve created my own CRAN repository since I wanted a quick upload. Perhaps in the future I’ll post on the main server but right now it’s actually rather convenient, although it took me a while to figure out exactly how this works.

Start by following the previous post and create zip and tar.gz files by the R CMD external tools. Now create a directory structure on your local drive before uploading (if this is what you want) to a webserver. Make sure your directory name is in English or you might run into trouble, I use C:\Software\cran for my repository.

The basic idea of the directory structure should be like this:

\___________________\2.17 and so on

Note that the src\contrib doesn’t have any R versions in it. The install –build produces the .zip version that’s put into the bin directory while the build gives the source version, the .tar.gz.

There needs to be a package file (PACKAGES & PACKAGES.gz) in each directory, it’s easy to create using the write_PACKAGES as done below:

# Prepare the binary
               verbose=TRUE, subdirs=TRUE,
               verbose=TRUE, subdirs=TRUE,
# Prepare the source catalog
               verbose=TRUE, subdirs=TRUE,

Flattr this!

This entry was posted in R. Bookmark the permalink.

Leave a Reply