track.setup(track)
track.setup()所属R语言包:track
Setup and stop tracking
设置和停止跟踪
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Functions to setup and stop tracking, and resync to a changed disk db
功能设置和停止跟踪,并重新同步到磁盘数据库
用法----------Usage----------
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, 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("high", "low"), dryRun = FALSE)
track.Last()
参数----------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)
被跟踪的路径中的位置的环境(默认值是1对全球环境)
参数: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.
被跟踪的环境。这是一种备选的方式(使用pos=)被跟踪指定的环境,但应很少需要。
参数:create
If TRUE, create the tracking directory if it doesn't exist
如果TRUE,创建跟踪目录,如果它不存在,
参数: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, vars or var means use the version in envir (and overwrite the version in the tracking directory)
控制时应采取的行动有相同的名称在跟踪目录和对象的envir:no是指停止,“files是指从跟踪目录使用的版本;和variables的,vars或var是指使用中的版本envir(覆盖跟踪目录中的版本)
参数:discardMissing
Discard all information about objects whose save file is missing?
放弃所有信息对象的保存文件丢失?
参数:cache
Should objects be keep cached in memory? Default is TRUE. This option is a shorthand way of supplying options=list(cache=...).
如果对象保持在内存中缓存?默认是TRUE。此选项的简写方式提供options=list(cache=...)。
参数:cachePolicy
Policy for keeping cached objects in memory. Default is tltPurge, for which cached objects are removed from memory at the end of a top-level task. This option is a shorthand way of supplying options=list(cachePolicy=...).
政策保持缓存内存中的对象。默认是tltPurge,而缓存的对象从内存中删除的顶级任务结束时。此选项的简写方式提供options=list(cachePolicy=...)。
参数:options
Option values (as a list) to be used for this tracking database. See track.options().
选项值(作为一个列表)被用于此跟踪数据库。见track.options()。
参数:all
If TRUE, all tracked environment are unlinked
如果TRUE,所有跟踪的环境是未链接
参数:auto
If TRUE, automatically track new variables and deleted variables in the environment (through use of a task callback). If auto==NULL, take the value from getOptions("global.track.options")$autoTrack, and if that is NULL, use TRUE
如果TRUE,自动跟踪新的变量和删除变量的环境中(通过使用一个任务回调)。如果auto==NULL,getOptions("global.track.options")$autoTrack值,如果是NULL,用TRUE
参数:readonly
Logical flag indicating whether the tracking db should be attached in a readonly mode. The global environment (pos=1 in the search path) cannot be tracked in a readonly mode.
逻辑标志指示是否应附着在一个只读模式的跟踪分贝。全球环境(pos=1在搜索路径中)无法被跟踪在只读模式。
参数:stop.on.error
If FALSE, failures to unlink a tracking environment are ignored, though a warning message is printed
如果FALSE,故障到取消链接跟踪环境的忽视,虽然一个警告消息,
参数:keepVars
If FALSE, all tracked variables are removed and will be no longer accessible. If TRUE, tracked variables will be left as ordinary variables in the environment, as well as remaining in files.
如果FALSE,所有跟踪的变量被删除,将不再能够访问。 TRUE如果,跟踪变量将保留为普通变量的环境中,以及其余的文件中。
参数:detach
If 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).
TRUE如果,环境上的搜索路径(2以外的位置)将分离后停止跟踪,如果它是由track.attach(),如果没有变量的环境中残留取出后,所有跟踪的变量。如果detach="force",附加的环境将被删除,即使有变量保持在它(虽然不若没有创建track.attach)。
参数:callFrom
A character string used in a message saying where track.stop() was called from.
的消息说,其中track.stop()被称为一个字符串。
参数:forgetModified
If TRUE, discard the versions of objects that are modified and in memory
如果TRUE,丢弃对象被修改的版本,在内存中
参数:RDataSuffix
The suffix to use for RData files. This should not normally need to be specified.
后缀使用为RData文件。这是不应该,通常需要作出具体规定。
参数:lockEnv
Should the environment be locked for a readonly tracking environment? The default is FALSE because locking the environment is irreversible, and it prevents rescanning or caching (because can't delete or add bindings)
如果环境被锁定为只读的跟踪环境?默认值是FALSE,因为锁定的环境是不可逆转的,它可以防止重新扫描或高速缓存(因为不能删除或添加绑定)
参数:check.Last
By default, a warning is issued if the .Last function in the track package is masked by any other .Last function. Supplying check.Last=FALSE inhibits this check and warning.
默认情况下,将发出警告,如果.Last的功能,track包被屏蔽任何其他.Last函数。供应check.Last=FALSE抑制这种检查和警告。
参数: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 TRUE, no changes are actualy made, but messages are printed describing what changes would be made.
如果TRUE,不进行任何更改actualy,但打印的消息说明会作出什么样的变化。
参数:sessionEnd
If TRUE, this is a call at the end of a session and no recovery from errors is possible – just try to as best as can to save objects as appropriate.
如果TRUE,这是一个呼叫会话结束时,没有错误恢复是可能的 - 只是尝试是最好的,可以适当保存对象。
参数:verbose
print a message about what directory is being tracked?
打印有关的消息被跟踪的是什么目录?
Details
详细信息----------Details----------
track.start: start tracking envir. If the tracking directory already exists, objects in it will be made
track.start:开始跟踪envir。如果跟踪目录已经存在,将在它的对象
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
track.stop:停止跟踪envir(默认是全球的环境)。未保存的值将被保存到文件第一。履带变量将变得不可用,除非keepVars=TRUE提供。如果没有提供参数,停止跟踪的全球环境(POS = 1)。 (在标准的使用,是没有问题的,只调用track.stop()之前退出ŕ,以为它会清除所有跟踪的环境,因为跟踪ENVS 1以外的位置
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.rescan:重新扫描跟踪目录,所以,如果有什么已经改变,目前的变量文件将被使用,而不是任何缓存在内存中。如果我们有一些修改的变量在内存中缓存,但不保存到磁盘,此功能将停止错误,除非forgetModified==TRUE。跟踪目录已经消失的变量将会消失知名度,并,跟踪变量添加到目录将成为可用的。
.Last: 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.attach()设置.Last在全球环境的价值track.Last,提供.Last不已经存在。 .Last会被称为R会话结束之前,在全球环境中的其余变量保存到.RData。 track.Last停止跟踪所有跟踪数据库,和移除跟踪瓦尔他们的环境。
值----------Value----------
参数:track.start, track.stop, track.rescan:
all return invisible(NULL) (this may change if it becomes clear what useful return values would be)
所有返回invisible(NULL)(这可能会改变,如果它变得清晰有用的返回值将是)
参数:track.Last:
calls track.stop(all=TRUE) to ensure that all tracking information and objects are written to files, and removes tracked variables from the environment.
调用track.stop(all=TRUE),以确保所有跟踪信息和对象写入文件,并删除跟踪变量的环境。
简单的用法----------Simple Usage----------
These functions have many arguments providing much control over tracking, but the arguments used in simple usage are:
这些功能有许多参数提供了不少跟踪控制,但使用的参数在简单的用法是:
(作者)----------Author(s)----------
Tony Plate <a href="mailto:tplate@acm.org">tplate@acm.org</a>
参见----------See Also----------
Overview and design of the track package.
track包的概述和设计。
实例----------Examples----------
library(track)
unlink("tmp1", recursive=TRUE)
track.start("tmp1")
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("tmp1")
ls(all=TRUE)
track.summary(time=0, access=1, size=FALSE)
track.stop(pos=1)
unlink("tmp1", recursive=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|