[R-pkg-devel] NOTE regarding dependencies in R code: Missing or unexported object

Duncan Murdoch murdoch.duncan at gmail.com
Sat Apr 21 16:44:56 CEST 2018


On 20/04/2018 3:53 PM, David Hervás via R-package-devel wrote:
> Hi,
> I have sent my package "clickR" to CRAN and was asked to fix the following NOTE:
> * checking dependencies in R code ... NOTE
> Missing or unexported object: 'lmerTest::summary'
> I'm not sure what's going on, here is the Imports section of my DESCRIPTION file:
> Imports: beeswarm, boot, lme4, lmerTest, methods, ReporteRs, xtable
> 
> 
> 
> Here are the first lines of the function causing this NOTE:
> report.merModLmerTest<-function(x, file=NULL, type="word", digits=3, digitspvals=3,                                font=ifelse(Sys.info()["sysname"] == "Windows", "Arial",                                            "Helvetica")[[1]], pointsize=11, info=TRUE, ...){  sx <- lmerTest::summary(x)  cor <- as.data.frame(lme4::VarCorr(x))  ...
> 
> And here is the output from getNamespaceExports("lmerTest") where "summary" is listed at position [23]
> 
>   [1] "lmer"                   "lsmeansLT"              ".__T__is.infinite:base" [4] ".__T__as.integer:base"  ".__T__as.numeric:base"  ".__T__%*%:base"         [7] ".__T__dim:base"         ".__T__summary:base"     ".__T__$<-:base"        [10] ".__T__^:base"           ".__T__sum:base"         ".__T__rep:base"        [13] ".__T__*:base"           ".__T__[<-:base"         ".__T__as.logical:base" [16] ".__T__dimnames:base"    ".__T__%/%:base"         ".__T__prod:base"       [19] ".__T__[[<-:base"        ".__T__/:base"           "step"                  [22] "calcSatterth"           "summary"                ".__T__anova:stats"     [25] ".__T__is.finite:base"   ".__T__anyNA:base"       ".__T__!:base"          [28] ".__T__all:base"         ".__T__+:base"           ".__T__any:base"        [31] ".__T__dim<-:base"       ".__T__-:base"           ".__T__[:base"          [34] "anova"                  "difflsmeans"            "lsmeans"               [37] "rand"                   ".__C__merModLmerTest"   ".__T__length:base"     [40] ".__T__is.na:base"       ".__T__dimnames<-:base"  ".__T__&:base"          [43] ".__T__%%:base"          ".__T__$:base"
> 
> 
> I have tried to reproduce this problem in my computer with different versions of R (3.4.4, 3.5 RC and R-devel) and only get the NOTE when performing the check with R-devel.
> What should I do to fix this?

getNamespaceExports() is described on its help page as an internal 
function, not intended for users.  If you want to see the exports of a 
package, look at its NAMESPACE file.  For example,

file.show(system.file("NAMESPACE", package="lmerTest"))

which lists these lines as exports:

export(as_lmerModLmerTest)
export(calcSatterth)
export(contest)
export(contest1D)
export(contestMD)
export(difflsmeans)
export(get_model)
export(lmer)
export(ls_means)
export(lsmeansLT)
export(ranova)
export(show_tests)
export(step)

The summary() function isn't listed there, as Rune demonstrated.

Duncan Murdoch


More information about the R-package-devel mailing list