rstudio / rstudio/packrat

Packrat doesn't install packages in local repository

Open
#418 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

I am migrating my project from Mac to Windows 10. When loading the project via RStudio and R 3.3.3, packrat loads a large number of packages but does not subsequently install them. After downloading when it restarts the session it writes:

Error in ensurePackageSymlink(source, target) : 
  Target 'C:/Users/jdv22/MarkdownProj/packrat/lib-R/base' already exists and is not a symlink
Loading required package: rugarch
Error in .requirePackage(package) : 
  unable to find required package ‘rugarch’
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘rugarch’
Error in loadNamespace(name) : there is no package called ‘rmarkdown’

If I run packrat::status(), packrat returns

Error in packageVersion("knitr") : package ‘knitr’ not found

Both packages are in the lib folder in packrat, together with a large number of other packages that aren't installed. If I try to install a package, for example ggplot2, I get the following:

> packrat::install_local("ggplot2")
Installing package from '/Users/jdv22/Dropbox/Algo/Rapportering/PQI.DK/Markdown/packrat/lib/x86_64-w64-mingw32/3.3.3/ggplot2'
Installing ggplot2
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\jdv22\Dropbox\Algo\Rapportering\PQI.DK\Markdown\packrat\lib\x86_64-w64-mingw32\3.3.3\ggplot2"  \
  --library="\\cued-fs/users/divf/jdv22/windows-home/Documents/R/win-library/3.3" --install-tests 
* installing *binary* package 'ggplot2' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
Warning: running command 'cp -R . "\\cued-fs/users/divf/jdv22/windows-home/Documents/R/win-library/3.3/ggplot2" || ( internal cd - .| (cd "\\cued-fs/users/divf/jdv22/windows-home/Documents/R/win-library/3.3/ggplot2" && internal -xf -))' had status 1
ERROR: installing binary package failed
* removing '\\cued-fs/users/divf/jdv22/windows-home/Documents/R/win-library/3.3/ggplot2'

I feel like I am missing something obvious. I just expected packrat to install all packages that I already had loaded.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows R 3.3.3 workflow with packrat::status() and packrat::install_local("ggplot2"), focusing on the existing packrat/lib packages and the ensurePackageSymlink error. Done means the local packages are installed successfully and required packages such as rugarch, rmarkdown, knitr, and ggplot2 load without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.