Closed hofnerb closed 9 years ago
To make the new dependency checks on CRAN happy go along the following recipe (as suggested by Kurt Hornik).
1.) Copy the functions listed after Undefined global functions or variables: in the output from R CMD check in a variable txt:
Undefined global functions or variables:
R CMD check
txt
txt <- "abline axis box hcl lines matlines matplot plot points polygon rgb"
2.) With the function
imports_for_undefined_globals <- function(txt, lst, selective = TRUE) { if(!missing(txt)) lst <- scan(what = character(), text = txt, quiet = TRUE) nms <- lapply(lst, find) ind <- sapply(nms, length) > 0L imp <- split(lst[ind], substring(unlist(nms[ind]), 9L)) if(selective) { sprintf("importFrom(%s)", vapply(Map(c, names(imp), imp), function(e) paste0("\"", e, "\"", collapse = ", "), "")) } else { sprintf("import(\"%s\")", names(imp)) } }
one can obtain the imports via
writeLines(imports_for_undefined_globals(txt))
3.) Copy and paste the output to NAMESPACE. 4.) Add the packages to Imports in DESCRIPTION.
NAMESPACE
Imports
DESCRIPTION
To make the new dependency checks on CRAN happy go along the following recipe (as suggested by Kurt Hornik).
1.) Copy the functions listed after
Undefined global functions or variables:
in the output fromR CMD check
in a variabletxt
:2.) With the function
one can obtain the imports via
3.) Copy and paste the output to
NAMESPACE
. 4.) Add the packages toImports
inDESCRIPTION
.