2

Coming from a python playground and being a big fan of virtualenv and ofcourse, a rookie in R, I intended to have a similar setup in my R projects and packages with the aid of packrat. (At least it seemed intuitive.)

So far, without packrat, I would run "Clean and Rebuild" on my package in RStudio and things worked as expected.

But now I have packrat installed and initialized on the project, which in turn, routes all the subsequent installs to the lib folder in the /packrat dir. This again is working as expected.

Now the issue is with rebuilding my package (which is btw, installed into the packrat by means of packrat::install() ) Every time I run "Clean and Rebuild" I get the following error in the Build window of RStudio:

==> roxygen2::roxygenize('.', roclets = c('rd', 'collate', 'namespace'))

Error in loadNamespace(name) : there is no package called ‘roxygen2’
Calls: suppressPackageStartupMessages ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted

Exited with status 1.

In reality, I have devtools, roxygen2 and other packages (including my own) installed with packrat.

What Am I missing?

Subbu
  • 37
  • 5
  • In general, the need for virtualenv is less in R than in Python, because you basically only have one implementation. Mostly, stuff "just works". I do a lot of package dev, and I've never really felt the need for multiple environments. – Hong Ooi May 28 '19 at 12:34

0 Answers0