rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

packrat::snapshot() fails #217

Open LongLingMichael opened 9 years ago

LongLingMichael commented 9 years ago

I'm using a third-party package “WindR" in my R packrat project. I've included the source of the package in local repo. But, when I type packrat::snapshot() in R console, it returns the following error

Error in read.dcf(...) : cannot open the connection In addition: Warning message: In read.dcf(...) : cannot open compressed file 'D:/PACKRAT_REPO/WindR', probable reason 'Permission denied'

Besides, I'm wondering if there's a way to ignore certain package like this one when calling snapshot? Thanks!

kevinushey commented 9 years ago

There currently isn't any mechanism to ignore particular dependencies in packrat, although this certainly would be nice to have.

I imagine having a project option, e.g. ignored.packages, would be helpful here, so that e.g. within a project you could write:

packrat::opts$ignored.packages(c("WindR"))

(open to suggestions regarding the name!)

kevinushey commented 9 years ago

On second thought, you could always load the library in such a way that packrat doesn't pick it up when examining for dependencies. For example:

ignored_library <- library
ignored_library(WindR)
LongLingMichael commented 9 years ago

Thanks! @kevinushey

I've read source code for snapshot.R, and I think I myself can add "WindR" into the ignore list. However, it would be much nicer if there's the option to write packrat::opts$ignored.packages(c("WindR")) as you suggested! Would this be updated in the next version?

kevinushey commented 9 years ago

I think we can target that for the next packrat release (or at least get it into the GitHub master soon-ish)

LongLingMichael commented 9 years ago

That's great! Thanks, man!