First of all, I am aware that my pain is totally self-inflicted.
In moving certain packages to the external.packages
option, I first uninstalled them from packrat using remove.packages()
rather than packrat::clean()
as recommended here by the package author.
The code in the project works just fine (as the external packages are properly loaded in the session), but since then it has been impossible to update the library. If I try to carry out a snapshot, I get the following error
Error: Unable to retrieve package records for the following packages:
- "knitr", "rmarkdown"
I tried reinstalling the packages afresh and packrat hollered back at me
Warning in install.packages :
packages ‘knitr’, ‘rmarkdown’ are in use and will not be installed
So, I tried to call the proper function with clean(c('knitr', 'rmarkdown'), force = TRUE)
and still no way out as I got this message
Error in find.package(pkgs, lib) :
there are no packages called ‘knitr’, ‘rmarkdown’
I tried to check whether the packages physically exist in the packrat library and they do!
> .libPaths()
[1] "C:/Users/Admn/Documents/.../cct/packrat/lib/x86_64-w64-mingw32/3.5.1"
[2] "C:/Users/Admn/Documents/.../cct/packrat/lib-ext/x86_64-w64-mingw32/3.5.1"
[3] "C:/Users/Admn/Documents/.../cct/packrat/lib-R/x86_64-w64-mingw32/3.5.1"
> c('knitr', 'rmarkdown') %in% .packages(all.available = TRUE)
[1] TRUE TRUE
> c('knitr', 'rmarkdown') %in%
list.dirs(.libPaths()[2], full.names = FALSE, recursive = FALSE)
[1] TRUE TRUE
I am seriously tempted to manually yank out the two folders from the library directory with unlink()
, but I suspect I might end up creating more problems.
If it can be avoided, I don't want to end up reinstalling the entire packrat library -- all 500MB of it -- given that I have access to painfully slow and expensive internet. Does anyone know the way out of this mess?