Hadley Wickham
2011-Aug-16 15:53 UTC
[Rd] sysdata.rda, namespaces and package dependencies
Hi all, I'm struggling with accessing a package dataset (munsell.map, stored in sysdata.rda) when that package is imported, not required. A simple reproducible example is: install.packages("munsell") munsell::mnsl("10B 4/6") # Error in match(col, munsell.map$name) : object 'munsell.map' not found library(munsell) munsell::mnsl("10B 4/6") # Function works correctly Am I doing something wrong, or is this namespace bug? Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
Hadley Wickham
2011-Aug-30 13:27 UTC
[Rd] sysdata.rda, namespaces and package dependencies
Bump. Any comments on this? Hadley On Tue, Aug 16, 2011 at 10:53 AM, Hadley Wickham <hadley at rice.edu> wrote:> Hi all, > > I'm struggling with accessing a package dataset (munsell.map, stored > in sysdata.rda) when that package is imported, not required. ?A simple > reproducible example is: > > install.packages("munsell") > munsell::mnsl("10B 4/6") > # Error in match(col, munsell.map$name) : object 'munsell.map' not found > > library(munsell) > munsell::mnsl("10B 4/6") > # Function works correctly > > Am I doing something wrong, or is this namespace bug? > > Hadley > > -- > Assistant Professor / Dobelman Family Junior Chair > Department of Statistics / Rice University > http://had.co.nz/ >-- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
Hadley Wickham
2011-Aug-30 15:27 UTC
[Rd] sysdata.rda, namespaces and package dependencies
> Your package is doing something weird, so I think it's you: ?you are loading > the munsell.map file via "load.r" in the top level of the package. ?That's > not a standard thing to do, and it's not being executed in the first case. > > Put that load statement into one of the files in the R directory and things > should be fine.I think that's a red-herring - load.r is for development and is never run during usual package installation. Or are you saying I need to explicit load data stored in sysdata.rda within the package? Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/