[R-pkg-devel] no visible global function definition for ‘par’

Dirk Eddelbuettel edd at debian.org
Tue Jan 31 03:50:19 CET 2017


On 30 January 2017 at 09:58, Kevin Ushey wrote:
| The correct thing to do is indeed import any functions from any R packages
| you use, base or otherwise. The simplest fix, if you don't want to
| selectively import such a large range of functions, is to simply add e.g.
| 
|     import(utils)
|     import(stats)
|     ... etc ...
| 
| to your NAMESPACE file.

Or do what R CMD check suggested and import the ones used, rather than all.

Which is what I had quoted earlier:

| Consider adding
| 
|   importFrom("grDevices", "as.raster", "dev.cur", "dev.off", "gray",
|              "heat.colors", "jpeg", "palette", "pdf", "png", "rainbow",
|              "terrain.colors", "tiff")
|   importFrom("graphics", "abline", "axis", "barplot", "box", "boxplot",
|              "image", "layout", "legend", "lines", "mtext", "par",
|              "plot", "plot.new", "points", "rasterImage", "strwidth",
|              "text", "title")
|   importFrom("stats", "TukeyHSD", "acf", "aov", "ccf", "coefficients",
|              "drop1", "end", "fft", "median", "model.tables",
|              "na.action", "na.omit", "pf", "ts", "var")
|   importFrom("utils", "read.table", "str", "tail", "write.table")
| 
| to your NAMESPACE file.

I find this preferable and quite appreciate that R CMD check provides it.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list