Gavin Simpson
2014-Aug-27 20:20 UTC
[Rd] Re R CMD check checking in development version of R
Dear list,
This is related to the change discussed in the thread "no visible binding
for global variables for data sets in a package".
I went to look at the Check results for one of my packages (analogue) on
CRAN: http://cran.r-project.org/web/checks/check_results_analogue.html
Under the r-devel build machines I'm seeing a lot of things like this:
Stratiplot.default : axis.VarLabs: no visible global function
definition for ?current.panel.limits?
Stratiplot.default : axis.VarLabs: no visible global function
definition for ?panel.axis?
Stratiplot.default : axis.VarLabs: no visible global function
definition for ?which.packet?
Stratiplot.default : axis.VarLabs: no visible global function
definition for ?axis.default?
Stratiplot.default: no visible global function definition for ?xyplot?
Stratiplot.default: no visible binding for global variable
?axis.default?
initCurve: no visible global function definition for ?cca?
initCurve: no visible global function definition for ?rda?
oldDistance.default: no visible global function definition for
?vegdist?
panel.Loess: no visible global function definition for
?trellis.par.get?
....
panel.Stratiplot: no visible global function definition for
?panel.abline?
plot3d.prcurve: no visible global function definition for ?rda?
prcurve: no visible global function definition for ?rda?
tran.default: no visible global function definition for ?wisconsin?
tran.default: no visible global function definition for ?decostand?
I realise that I don't importFrom all of those functions in NAMESPACE -
I've missed some so this list is actually very handy. But also I Depend on
packages that provide some of the function complained about.
Is that the cause of these NOTEs? Is the expectation that if I am using a
function from a package, even a package that I have in Depends:, that I
have to explicitly declare these imports in NAMESPACE?
I'm just seeking a bit of clarification on what this new check aims to test
and what is the ideal solution in the view of R Core given this change to R
CMD check.
Thanks in advance
Gavin
--
Gavin Simpson, PhD
[[alternative HTML version deleted]]
Hadley Wickham
2014-Aug-27 21:24 UTC
[Rd] Re R CMD check checking in development version of R
> Is that the cause of these NOTEs? Is the expectation that if I am using a > function from a package, even a package that I have in Depends:, that I > have to explicitly declare these imports in NAMESPACE?Yes. (Otherwise your package won't work if it's only attached and not loaded. i.e. if someone does analogue::foo() only the imported functions are available, not the functions in packages you depend on) (And really you shouldn't have any packages in depends, they should all be in imports) Hadley -- http://had.co.nz/