is_from_namespace | R Documentation |
A coarse way to find if a function comes from a package.
is_from_namespace(x, recursive = TRUE)
x |
function, environment, language (with environment attached) |
recursive |
whether to recursively search parent environments |
logical true if x
or its environment is
defined in a namespace; returns false if the object is atomic, or defined
in/from global environment, or an empty environment.
is_from_namespace(baseenv()) # TRUE
is_from_namespace(utils::read.csv) # TRUE
x <- function(){}
is_from_namespace(NULL) # FALSE
is_from_namespace(x) # FALSE
is_from_namespace(emptyenv()) # FALSE
# Let environment of `x` be base environment
# (exception case)
environment(x) <- baseenv()
is_from_namespace(x) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.