Save a context
context_save(
path,
packages = NULL,
sources = NULL,
package_sources = NULL,
envir = NULL,
storage_type = NULL,
storage_args = NULL,
name = NULL,
root_id = NULL
)
Path to save the context in
Optional character vector of packages to save into
the context. Alternatively, can be a list with elements
loaded
and attached
if you want to ensure some
packages are loaded but not attached.
Character vector of source files to read in. These should define functions and (perhaps) other "global" objects, but should not do any serious computation.
Optional information about where to find
non-CRAN packages, created by conan::conan_sources
The current environment. This is used to copy
local variables around. For context_load
this is
the environment into which the global environment is copied.
Specify a non-global environment here to avoid clobbering the
workspace, but at the risk that some environments may not
restore exactly as desired. If this is used, then every new R
session, running context_save
will create a new context
id.
Character vector indicating the storage type
to use. Options are "rds"
(the default) and
"environment"
(for testing and local use).
Arguments passed through to the storage driver
An optional name for the context. This will be
printed with the context in some situations (such as
context_info
)
Force a context root id. This is intended for
advanced use only. By setting the root id, two contexts
created with storage in different file locations (path
)
will get the same id. This is required for using a
server-hosted database to share a context between different
physical machines (or different docker containers). The id, if
provided, must be compatible with ids::random_id()
-
i.e., a 32 character hex string. This option can be left alone
in most situations.