Since the latest R update I get the Note
summary.xmlImport: no visible global function definition for ‘median’
in the CRAN check. Further notes refer to read.table
, write.table
and other standard functions in R.
When I have a look on my file summary.xmlImport, the file looks like this:
summary.xmlImport <- function(object, ...){
rowCount <- sapply(object,nrow)
cat("Summary of xmlImport object
")
cat("---------------------------
")
cat("Sequences :",length(object),"
")
cat("Min hits :",min(rowCount),"
")
cat("Average hits :",mean(rowCount),"
")
cat("Median hits :",median(rowCount),"
")
cat("Max hits :",max(rowCount),"
")
invisible(object)
}
I cannot understand, why I should add now the median
function to the NAMESPACE, but why not the min
, mean
, etc. The note is only about the median
function.
Anybody an idea what the reason for the Note is and how to fix it? I noted that there are tons of R packages that have currently the same Note.
I can understand this warning in the context of a non-declared variable, but I would assume that median()
, read.table()
and such functions are globally visible in R, especially as mean()
seems to be!?
EDIT: I only receive the Note on CRAN, but not on my local computer what makes the search for the solution a bit nasty... The session info of my computer:
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…