kkdey / CountClust

A R package for Grade of Membership model and Visualization of counts data:
31 stars 11 forks source link

library() shouldn't be called inside a package. #10

Closed dcgerard closed 8 years ago

dcgerard commented 8 years ago

For example, https://github.com/kkdey/CountClust/blob/master/R/StructureGGplot.R#L61

See: http://r-pkgs.had.co.nz/namespace.html#search-path

You should either include functions from other packages in the NAMESPACE file or call them explicitly using ::. Since you are using roxygen2, you can include @importFrom in the comments.

dcgerard commented 8 years ago

Same with require(): https://github.com/kkdey/CountClust/blob/master/R/polarBarChart.R#L28

dcgerard commented 8 years ago

If you are going to submit to CRAN, they have it in their policy statement that the package shouldn't modify the global environment: https://cran.r-project.org/web/packages/policies.html#Source-packages