track.setup {trackObjs}R Documentation

Setup and stop tracking

Description

Functions to setup and stop tracking.

Usage

track.start(dir, pos = 1, envir = as.environment(pos), create = TRUE,
        clobber = c("no", "files", "variables"), cache=NULL, options=NULL,
        RDataSuffix=NULL)
track.stop(pos = 1, envir = as.environment(pos), all=FALSE, stop.on.error=FALSE)
env.is.tracked(pos = 1, envir = as.environment(pos))
tracked.envs(envirs=search())
track.restart(pos = 1, envir = as.environment(pos), forget.modified = FALSE)

Arguments

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 pos=) of specifying the environment being tracked, but should be rarely needed.
create If TRUE, create the tracking directory if it doesn't exist
clobber Controls action taken when there are objects of the same name in the tracking directory and in envir: "no" means stop; "files" means use the version from the tracking directory; and "variables" means use the version in envir (and overwrite the version in the tracking directory)
cache Should objects be keep cached in memory? Default is FALSE. This option is a shorthand way of supplying options=list(cache=TRUE).
options Option values (as a list) to be used for this tracking database. See track.options().
all If TRUE, all tracked environment are unlinked
stop.on.error If FALSE, failures to unlink a tracking environment are ignored, though a warning message is printed
envirs A list or vector of objects that can be interpreted as environments by as.environment
forget.modified If TRUE, discard copies that are modified and in memory
RDataSuffix The suffix to use for RData files. This should not normally need to be specified.

Details

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. Tracked variables will become unavailable (any unsaved values will be saved to files first.)
track.restart:
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 forget.modified==TRUE. Variables that have disappeared from the tracking dir will disappear from visibility, and variables added to the tracking dir will become available.

Value

track.start, track.stop, track.restart: all return invisible(NULL) (this may change if it becomes clear what useful return values would be)
env.is.tracked: returns TRUE or FALSE
tracked.envs: with no arguments, it returns the names of tracked environment that are on the search list. If given an argument that is a vector of environments (or environment names), it returns the subset of that vector that are tracked environments.

Author(s)

Tony Plate <tplate@acm.org>

See Also

Overview and design of the trackObjs package.

Examples

library(trackObjs)
unlink("tmp1", recursive=TRUE)
track.start("tmp1")
track(x <- 33)
X <- array(1:24, dim=2:4)
track(X)
track(Y <- list(a=1:3,b=2))
X[2] <- -1
track.summary(time=0, access=1, size=FALSE)
env.is.tracked(pos=1)
env.is.tracked(pos=2)
ls(all=TRUE)
track.stop()
ls(all=TRUE)
track.start("tmp1")
ls(all=TRUE)
track.summary(time=0, access=1, size=FALSE)
track.stop()
unlink("tmp1", recursive=TRUE)

[Package trackObjs version 0.8-3 Index]