Description Usage Arguments Details Value Simple Usage Author(s) See Also Examples
Functions to setup and stop tracking, and resync to a changed disk db
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | track.start(dir="rdatadir", pos = 1, envir = as.environment(pos),
create = TRUE,
clobber = c("no", "files", "variables", "vars", "var"),
discardMissing = FALSE,
cache = NULL, cachePolicy = NULL, options = NULL,
RDataSuffix = NULL, auto = NULL, readonly = FALSE,
lockEnv = FALSE, check.Last = TRUE, autoCheckSize = 1e6, verbose = TRUE)
track.stop(pos = 1, envir = as.environment(pos), all = FALSE,
stop.on.error = FALSE, keepVars = FALSE, sessionEnd = FALSE,
verbose = TRUE, detach = TRUE, callFrom = NULL)
track.rescan(pos = 1, envir = as.environment(pos), discardMissing = FALSE,
forgetModified = FALSE, level = c("low", "high"), dryRun = FALSE,
verbose = TRUE)
track.Last()
|
dir |
The directory where tracking data is stored |
pos |
The search path position of the environment being tracked (default is 1 for the global environment) |
envir |
The environment being tracked. This is an alternate way
(to the use of |
create |
If |
clobber |
Controls action taken when there are objects of the
same name in the
tracking directory and in |
discardMissing |
Discard all information about objects whose save file is missing? |
cache |
Should objects be keep cached in memory? Default is |
cachePolicy |
Policy for keeping cached objects in memory.
Default is |
options |
Option values (as a list) to be used for this tracking database. See |
all |
If |
auto |
If |
readonly |
Logical flag indicating whether the tracking db should be attached in
a readonly mode. The global environment ( |
stop.on.error |
If |
keepVars |
If |
detach |
If |
callFrom |
A character string used in a message saying where
|
forgetModified |
If |
RDataSuffix |
The suffix to use for |
lockEnv |
Should the environment be locked for a readonly
tracking environment? The default is |
check.Last |
By default, a warning is issued if the |
autoCheckSize |
If there are objects with the same name in an
existing tracking db being attached, and the environment, and |
level |
Should the rescan be done at a high or low level: a high level just stops tracking and restarts it; a low level tries to individually bring the environment in line with the file database. |
dryRun |
If |
sessionEnd |
If |
verbose |
print a message about what directory is being tracked? |
track.start
: start tracking envir
. If the
tracking directory already exists, objects in it will be made
accessible, otherwise it will be created (unless create=FALSE
).
track.stop
: stop tracking envir
(default is
the global environment). Unsaved
values will be saved to files first. Tracked variables will
become unavailable unless keepVars=TRUE
is supplied. If no
arguments are supplied, stops tracking the global environment
(pos=1).
(In standard use, there is not a problem with only calling
track.stop()
prior
to quitting R, thinking that it will cleanup all tracked
environments, because tracked envs at positions other than 1 will
be attached readonly.)
track.rescan
: Rescan the tracking dir, so that if anything has changed there,
the current variables on file will be used instead of any cached
in memory.
If we have some modified variables cached in memory but not saved
to disk, this function will stop with an error unless
forgetModified==TRUE
.
Variables that have disappeared from the tracking dir will disappear
from visibility, and variables added to the tracking dir will become
available.
track.start()
or track.attach()
set
.Last
in the global env to have the value
track.Last
, provided .Last
does not already exist
there. .Last
will be called
at the end of an R session, before the remaining variables in the
global environment are saved to .RData
. track.Last
stops tracking all tracking db's, and removes tracked vars from
their environments.
track.start, track.stop, track.rescan: |
all return |
track.Last: |
calls |
These functions have many arguments providing much control over tracking, but the arguments used in simple usage are:
1 2 3 4 | track.start()
track.start(dir = "rdatadir")
track.stop(pos = 1, all = FALSE)
track.rescan(pos = 2)
|
Tony Plate tplate@acm.org
Overview and design of
the track
package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ##############################################################
# Warning: running this example will cause variables currently
# in the R global environment to be written to .RData files
# in a tracking database on the filesystem under R's temporary
# directory, and will cause the variables to be removed temporarily
# from the R global environment.
# It is recommended to run this example with a fresh R session
# with no important variables in the global environment.
##############################################################
library(track)
track.start(dir=file.path(tempdir(), 'rdatadir9'))
x <- 33
X <- array(1:24, dim=2:4)
Y <- list(a=1:3,b=2)
X[2] <- -1
track.datadir(relative=TRUE)
track.filename(list=c("x", "X"))
track.summary(time=0, access=1, size=FALSE)
env.is.tracked(pos=1)
env.is.tracked(pos=2)
ls(all=TRUE)
track.stop(pos=1)
ls(all=TRUE)
track.start(dir=file.path(tempdir(), 'rdatadir9'))
ls(all=TRUE)
track.summary(time=0, access=1, size=FALSE)
# Would normally not call track.stop(), but do so here to clean up after
# running this example.
track.stop(pos=1, keepVars=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.