[R-pkg-devel] no visible global function definition for ‘par’
Cathy Lee Gierke
leegi001 at umn.edu
Tue Jan 31 09:26:32 CET 2017
Thank you. Makes sense. It is *very* helpful to have R CMD check provide
that.
Cathy Lee Gierke
*“Darkness cannot drive out darkness: only light can do that. Hate cannot
drive out hate: only love can do that.” *
*“The arc of the moral universe is long, but it bends towards justice.”*
*“Nothing in the world is more dangerous than sincere ignorance and
conscientious stupidity.” *
*“Never forget that everything Hitler did in Germany was legal.” *
*“Forgiveness is not an occasional act, it is a constant attitude.” *
*“Injustice anywhere is a threat to justice everywhere.” *
― Martin Luther King Jr.
<http://www.goodreads.com/author/show/23924.Martin_Luther_King_Jr_>
On Tue, Jan 31, 2017 at 2:17 AM, Martin Maechler <maechler at stat.math.ethz.ch
> wrote:
> >>>>> Dirk Eddelbuettel <edd at debian.org>
> >>>>> on Mon, 30 Jan 2017 20:50:19 -0600 writes:
>
> > 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
>
> yes, and that is not only Dirk :
>
> It *is* highly preferable and recommended, also in *the*
> reference manual ("Writing R Extensions", aka WRE) for reasons
> of
> - efficiency,
> - modularity and "self-documentation"
> - much better control against accidental name clashes,
>
> There are very few exceptions where importing a whole namespace
> makes sense and the above base packages are typically never part
> of these exceptions.
>
> Martin Maechler
> ETH Zurich and R Core
>
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list