5

I have 2 RStudio projects, and one of them (project RED) depends on the other (project BLUE, besides many other CRAN dependencies). I've always installed both projects and all CRAN dependencies globally on my computer, but now I am trying to adapt them to packrat in a new computer (for now I have only installed globally the packrat package itself).

  1. I don't really need to configure any local repository (it is just a single dependency on another local project), and I've read that I don't actually need to do that.
  2. On RStudio, I open project BLUE and go to Build > Install and Restart, and all CRAN dependencies get installed locally thanks to packrat. Everything is great and I get the installation path: /Users/MYUSER/Documents/GitHub/PATHTOMYPROJECT/packrat/lib/x86_64-apple-darwin15.6.0/3.6.1
  3. I open then project RED and select packrat > Use packrat with this project > Add local repository > [Path of step 2]

And then I get this error:

> packrat::init(options = list(local.repos = c("~/Documents/GitHub/PATHTOMYPROJECT/packrat/lib/x86_64-apple-darwin15.6.0/3.6.1")))
Initializing packrat project in directory:
- "~/Documents/GitHub/PATHTOMYPROJECT"
Error in read.dcf(...) : no se puede abrir la conexión
Además: Warning message:
In read.dcf(...) :
  cannot open file '/Users/MYUSER/Documents/GitHub/PATHTOMYPROJECT/packrat/lib/x86_64-apple-darwin15.6.0/3.6.1/NAMEOFTHELIB': it is a directory
thelawnmowerman
  • 11,956
  • 2
  • 23
  • 36
  • A reproducible example with 2 dummy projects would help – Stefan Avey Jul 19 '19 at 16:55
  • So, do you confirm what I am doing is correct? I don't even know that, since the docs on this topic are really vague. Do you think the problem is just related to my specific projects? – thelawnmowerman Jul 20 '19 at 23:25
  • It's not 100% clear to me so an example would help. If I understand correctly I suggest you only open project RED, turn on Packrat, and then install project BLUE (I'm assuming this is an R package) using `install.packages(path_to_file, repos = NULL, type="source")`. – Stefan Avey Jul 22 '19 at 14:03

0 Answers0