rstudio / rstudio/packrat

Add note or better handling for dealing with installing packages from source vs. binary in packrat.init

Open
#245 1 comment 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

When using packrat.init(), I think in most cases there is an expectation that this works automatically, with no user input required once the command has been issued.

For example, I have a project that requires the "sp" package, which in my environment has a newer source version than binary. When installing "sp" with install.packages(), it brings up the prompt:

  There is a binary version available but the source version is later:
   binary source needs_compilation
sp  1.1-1  1.2-0              TRUE

Do you want to install from sources the package which needs compilation?
y/n: 

However, with packrat.init(), most of that prompt is cut off and all I get is y/n: and I have to make a choice for the initialization to proceed. This is bad first of all because the average user won't y/n is referring to, but also because I don't want packrat.init() to be interactive.

After looking here, I realized I could just set

options(install.packages.compile.from.source = TRUE)

which takes care of the problem. This might be worth noting in the docs.

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 with the packrat.init() behavior described in the issue and review the R installation prompt and the install.packages.compile.from.source option. Update the relevant documentation to explain the source-versus-binary prompt, why packrat.init() may show only y/n, and how the option avoids interactive input.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.