3

I am using packrat_0.4.3 and have some my own packages.

I follow this introduction to create a local repository: http://cran.r-project.org/doc/manuals/R-admin.html#Setting-up-a-package-repository, then use this command to init packrat:

packrat::init(options = list(local.repos = c("~/Projects/www/htdocs/R/src/contrib/")))

But packrat still cannot find my local packages.

How should I fix it? Thanks for any suggestion.

Bangyou
  • 9,462
  • 16
  • 62
  • 94

1 Answers1

1

The reference cited describes how to set up a CRAN like repository, however for packrat this is not required, you can just create a local directory.

Try this:

mkdir ~/local_repo
cp my_package ~/local_repo

So that local_repo looks like:

local_repo/
  my_package/
    R/
    ...

Then in R:

packrat::init()
packrat::set_opts(local.repos = c("~/local_repo"))
packrat::install_local('my_package')

If some tries this and runs into issues, let me know. I'm happy to amend the answer until this is resolved.

rmg
  • 1,009
  • 16
  • 31