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\n")
cat("---------------------------\n")
cat("Sequences :",length(object),"\n")
cat("Min hits :",min(rowCount),"\n")
cat("Average hits :",mean(rowCount),"\n")
cat("Median hits :",median(rowCount),"\n")
cat("Max hits :",max(rowCount),"\n")
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 medianfunction.
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