Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packrat::clean and packrat::restore functions fail due to ignored packages #525

Closed
markusdumke opened this issue Jan 2, 2019 · 2 comments

Comments

@markusdumke
Copy link

Hi,

I came across some errors with the packrat::clean and packrat::restore functions when working with ignored local packages.

I have a local R package included in my repository and added it to the ignored.packages. Then I have installed it with packrat::install("mypackage").

Then packrat::clean() will fail with the error message:

Error: Unable to retrieve package records for the following packages:

  • "mypackage"

I have debugged the source code and found that a simple change in packrat:::unused_packages will fix it:
orphans <- setdiff(orphans, c("manipulate", "rstudio", packrat::opts$ignored.packages()))

Can you explain why you did not choose to ignore the packages listed in ignored.packages here? Though it might be strange that the package is listed in orphans though it is still in use. Maybe that is the point where something goes wrong? Happy, if you can help!

The same issue holds with packrat::restore.

I am using packrat 0.5.0.

kevinushey added a commit that referenced this issue Jan 7, 2019
@kevinushey
Copy link
Contributor

Thanks for the bug report + diagnosis. This was likely just an oversight.

@pazzini10
Copy link

pazzini10 commented Sep 16, 2020

packrat::snapshot() works well with packrat::opts$ignored.packages("stat.desc") but packrat::restore() doesn't work.
stat.desc is my own package. I must move stat.desc, make restore then copy again package stat.desc inside packrat...

Error: Unable to retrieve package records for the following packages:

  • 'stat.desc'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants