Question about local v public packages

Open
#238 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the reported workflow with packrat::init(), install_local() for pkgA and pkgB, and snapshot() using the stated local repository. Start by tracing how snapshot selects package sources when a local package shares a name with a CRAN package. Done when the modified local pkgB is recorded rather than the current CRAN version.

Written by the indexing model from the issue text.

Description

Let's say I begin a project using the packrat command as so:

packrat::init("C:/project",option=list(local.repos='C:/packages/r'))

Then lets say I have two local packages to install along with the packages from a CRAN

install_local('pkgA',repos='C:/packages/r')
install_local('pkgB',repos='C:/packages/r')

pkgA is a package that I have created myself and stored locally.
pkgB is a package that I have modified for my use from a well-known public package

Both installations work fine but when I go to snapshot()

Fetching sources for pkgA ... OK (local)
Fetching sources for pkgB ... OK (CRAN current)

It seems that snapshot looks to my CRAN before it looks to my local repos and since my modified package and a publicly available package share the same name, it snapshots the current CRAN version instead.

Is there any easy fix to this behavior? Perhaps something that I should be doing differently?

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

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.

More from rstudio/packrat

All issues in rstudio/packrat

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.