briandk / granovaGG

Bob Pruzek and Jim Helmreich's implementation of Elemental Graphics for Analysis of Variance
Other
15 stars 4 forks source link

granovaGG should depend on ggplot2 but import everything else #136

Closed briandk closed 12 years ago

briandk commented 12 years ago

Currently, we state dependencies upon a number of other packages:

Depends:
    R (>= 2.13.0),
    ggplot2 (>= 0.8.9),
    RColorBrewer,
    gridExtra,
    MASS

As an alternative to Depends, we could Import some of these packages. The difference is that when a package is imported, it would be available to granovaGG, but it wouldn't mask other functions in the global namespace.

I think many of these dependencies would be better served as Imports, and some are entirely unnecessary. Some packages, like RColorBrewer, bring a bunch of functions into the global namespace just so our package can use one. Other packages, like MASS, don't seem to get called at all. Ever. I propose that we could rewrite our Depends section like this:

Depends:
    R (>= 2.13.0),
    ggplot2 (>= 0.8.9),
Imports:
    RColorBrewer
    gridExtra
    plyr

It still makes sense to me to depend on ggplot2, since that will make a bunch of plot customization functions available in the global namespace. And it makes sense to me to be explicit about the fact that we use some plyr functions. But I think it would be cleaner and kinder to our users not to litter their global namespace with functions they probably won't use and we definitely won't use.

I also think we should remove the import(ggplot2) call from NAMESPACE, since I believe it's redundant with the dependency.

References

http://stackoverflow.com/questions/6427501/cleaning-up-function-list-in-an-r-package-with-lots-of-functions/6428002#6428002 http://cran.r-project.org/doc/manuals/R-exts.html#Package-namespaces

rmpruzek commented 12 years ago

Any decision you make along these lines is ok by me...FWIW.