pos
on the search path.
track.attach(dir, pos = 2, name = NULL, create = FALSE, readonly = !create, lockEnv = FALSE, verbose = TRUE, auto = NULL, dup.ok = FALSE)
track.detach(pos = NULL, name = NULL, detach = TRUE)
pos=1
in the search
path) cannot be tracked in a readonly mode.
FALSE
because locking the
environment is irreversible, and it prevents rescanning or caching
(because can't delete or add bindings)TRUE
, the environment attached to the search
path (in a position other than 2) will be detached after stopping
tracking, IF it was created by track.attach()
and if there are no
variables left remaining in the environment after removing
all tracked variables. If detach="force"
, the attached
environment will be removed even if there are variables remaining in
it (though not if it was not created by track.attach
).track.start
).
dup.ok=FALSE
(the default) and the
tracking database is already attached, the function issues a warning
and does nothing.
track.attach
attaches a new environment to the search path at the specified
position and variables in the tracking database are made available in
it through lazy loading. Using readonly==TRUE
ensure that no
changes at all are made to the tracking database, and the environment
is locked to ensure that variables cannot be created or deleted. track.detach
syncs all variables to files and detaches the
environment from the search list if it is empty. See
track.stop
for conditions under which the
environment may not be detached.
track.start
## Not run:
# track.attach("path/to/tracking-database", pos=2, name="trackdb")
# track.detach(pos=2)
# ## End(Not run)
Run the code above in your browser using DataCamp Workspace