app_env | R Documentation |
Save dependencies for future functions in an environment and put app dependencies into lists
dependencies
Dependency environment
app_deps
(list)
with all app dependencies as character vectors
merge_deps_to_env()
Pass all dependencies saved from previous functions to an environment for use
app_env$merge_deps_to_env(..., env = rlang::caller_env(), as_list = FALSE)
...
(character)
names of objects to share with env
. Default load all previously stored objects.
env
(environment)
to pass dependencies to. Default the calling environment
as_list
(logical)
TRUE
return the named objects as a list. FALSE
saves them directly to the environment
gather_deps()
Gather the objects passed to app_env
s internal environment to be passed to subsequent functions. Save app dependencies into a list.
app_env$gather_deps(..., app_deps = TRUE, env = rlang::caller_env())
...
(objects)
Dependencies for subsequent functions, passed as named objects or a character of the object name. If no name is provided, the name of the object will be retained. Use "everything"
to capture all objects from the parent environment.
app_deps
(logical/list)
Default: TRUE
to save all app dependencies specified at initialization of the app_env
object. Otherwise, a named list of the dependencies to save as a character vector with the list names corresponding to the apps for which to save the dependencies..
env
(env)
The environment from which objects should be saved. Default: the calling environment
(environment)
The app_env
object with the saved objects in the internal environment.
set_parent()
Set the given environment to inherit from the internal 'global' environment
app_env$set_parent(vars_to_remove = NULL, env = rlang:::caller_env())
vars_to_remove
missing variables to remove from env that will otherwise mask the objects in the parent environment
env
child environment
load_deps()
Load backed up dependencies from path
app_env$load_deps(deps, path = file.path("data", "backup"))
deps
(chr)
of deps to search for and load
path
(character)
path to folder with backed up dependencies
deps_to_destination()
Write deps
to a folder via file.copy
or to dropbox. If using dropbox, requires an authorized token to dropbox. See dropbox_auth
.
app_env$deps_to_destination( deps = TRUE, dest_folder = file.path("..", c("Rminor", "RminorElevated"), "data"), remote = FALSE, clean = FALSE )
deps
(character/logical)
character vector of files to write to disk. Or TRUE
Default to use app_deps
. Use "all"
to write all objects in the dependencies
environment to dest_folder
.
dest_folder
(character)
folder(s) to transfer deps to - must be same length as deps
or length 1 and will be recycled if deps
is a list. When dropbox = TRUE th(is/ese) folder(s) will be used to stage files for upload.
remote
(logical/character)
Transfer deps
to the root folder assigned by the API key (HMIS Apps at COHHIO) on Dropbox.
clean
(logical)
clean unused dependencies from folder. Default FALSE
to preserve unused dependencies in dest_folder
None. This function is called for its side effects.
new()
Instantiate with default app dependencies to be collected (if they exist) each time \$gather_deps
is called
app_env$new(app_deps, dirs = clarity.looker::dirs, guidance, data_types)
app_deps
(list)
with each app and it's dependencies as a character vector. See app_deps
for formatting.
dirs
(list)
See dirs
guidance
(list)
that is named of character vectors with guidance for each type of Data Quality Issue. See ?guidance
data_types
(list)
that is named with common groupings of HUD CSV data types. See ?data_types
clone()
The objects of this class are cloneable with this method.
app_env$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.