I have created a R project in RStudio and now I am trying to initialize Packrat with the following command:
packrat::init(options = list(auto.snapshot = TRUE, vcs.ignore.src = TRUE, use.cache = TRUE))
These are the packages that tries to add to packrat:
Adding these packages to packrat:
_
Rcpp 1.0.2
base64enc 0.1-3
digest 0.6.20
evaluate 0.14
glue 1.3.1
highr 0.8
htmltools 0.3.6
jsonlite 1.6
knitr 1.24
magrittr 1.5
markdown 1.1
mime 0.7
packrat 0.5.0
rmarkdown 1.14
stringi 1.4.3
stringr 1.4.0
tinytex 0.15
xfun 0.8
yaml 2.2.0
But when it tries to install knitr, the following error occurs:
Error: Command failed (1)
Failed to run system command:
'/usr/lib/R/bin/R' --vanilla CMD INSTALL '/tmp/RtmpequoVT/knitr' --library='/path/to/project/NewProject/packrat/lib/x86_64-pc-linux-gnu/3.6.1' --install-tests --no-docs --no-multiarch --no-demo
The command failed with output:
* installing *source* package 'knitr' ...
** package 'knitr' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
Error : package 'stringi' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error: unable to load R code in package 'knitr'
Execution halted
ERROR: lazy loading failed for package 'knitr'
* removing '/path/to/project/NewProject/packrat/lib/x86_64-pc-linux-gnu/3.6.1/knitr'
Además: Warning messages:
1: In untar(src, exdir = target, compressed = "gzip") :
argument 'compressed' is ignored for the internal method
2: In untar(src, compressed = "gzip", list = TRUE) :
argument 'compressed' is ignored for the internal method
I have removed knitr and stringi and installed them again, but the error remains. What can I do? Thank you in advance!