library(codetoolsBioC)
findGlobalsBioC <- codetoolsBioC:::findGlobalsBioC
globals <- findGlobalsBioC(function() cat())
print(globals)
stopifnot(all(is.element(c("cat"), globals)))
globals <- findGlobalsBioC(function() { cat() })
print(globals)
stopifnot(all(is.element(c("{", "cat"), globals)))
globals <- findGlobalsBioC(function() { cat(); print(1) } )
print(globals)
stopifnot(all(is.element(c("{", "cat", "print"), globals)))
## Imports via :: and :::
globals <- findGlobalsBioC(function() base::cat(), merge=FALSE)
str(globals)
stopifnot(all(is.element(c("base::cat"), unlist(globals))))
globals <- findGlobalsBioC(function() base:::cat(), merge=FALSE)
str(globals)
stopifnot(all(is.element(c("base:::cat"), unlist(globals))))
## Real-world examples (also uses ::)
globals <- findGlobalsBioC(stats::Gamma, merge=FALSE)
str(globals)
globals <- findGlobalsBioC(tools::pkgDepends, merge=FALSE)
str(globals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.