RStudio, Packrat and Knitr

I am working in RStudio. I first created a knitr file in the project and the PDF compilation worked flawlessly. Then, when I was working on different files, I activated packrat

for the project. (And later deactivate it again)

Now when I try again in Knitr (compile pdf) my file .Rnw

, I get

Initializing packrat project in directory:
- "mydir"
Error in appDependencies(project) : 
  could not find function "available.packages"
Calls: source ... sort_c -> with_collate -> force -> sort -> appDependencies
Execution halted

      

I checked the RStudio project options and packrat is not installed. Switching from Knitr to sweave didn't help. Also, I ensured that the outfit is fitted.

What can I do?

+3


source to share


1 answer


If you have activated Packrat for your project and for some reason packrat::disable()

did not clear the created one .Rprofile

, you may need to delete it manually.

If your project's base directory is .Rprofile

, and it contains, for example,

#### -- Packrat Autoloader (version 0.4.1.24) -- ####
source("packrat/init.R")
#### -- End Packrat Autoloader -- ####

      



you will need to remove this bit.

Alternatively, you can provide loading utils

( available.packages

is a function from utils

) in your vignette; for example with library(utils)

.

+1


source







All Articles