get_obj | R Documentation |
Gets copies of objects from parent environments, or returns alternative if not found
get_obj(name, frame = parent.frame(), alt = NULL)
name |
text string of an object to find |
alt |
an alternative to return if the object is not found |
this is designed to use within functions in the library to access global objects, but provide a route to avoid hard-coding specific variable names in. It is not exported.
either a copy of the object name
or an alternative if it does
not exist
library(cctu)
rm(PATH)
cctu:::get_obj("PATH")
cctu:::get_obj("PATH", alt = getwd())
PATH <- "C:/MyFile"
cctu:::get_obj("PATH")
cctu:::get_obj("PATH", alt = getwd())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.