briandk/granovaGG — Issue #136: granovaGG should depend on ggplot2 but import everything else
Author: briandk
Created: 2011-11-11 06:26:26+00:00
State: open
Labels: Design

Currently, we [state dependencies][1] 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.

**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

[1]: https://github.com/briandk/granovaGG/blob/c038ae75b0191ece2247722d417763a3b499c9c3/DESCRIPTION#L12-17