track(trackObjs)
track()所属R语言包:trackObjs
Manage how objects are handled in a tracking session
管理对象是如何处理一个跟踪会话
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Functions to start and stop tracking objects, remove them, load objects from RData files, and manage cached and saved copies of objects.
启动和停止跟踪对象的函数,删除,加载对象从RDATA文件,管理对象的缓存,并保存副本的。
用法----------Usage----------
track(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = FALSE)
untrack(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = FALSE, keep.in.db = FALSE)
track.remove(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = FALSE)
track.save(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = missing(expr))
track.resave(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = missing(expr))
track.flush(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = missing(expr))
track.forget(expr, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, all = FALSE)
track.load(files, pos = 1, envir = as.environment(pos), list = NULL,
pattern = NULL, glob = NULL, cache = FALSE, clobber = FALSE,
time.of.file = TRUE, warn = TRUE)
参数----------Arguments----------
参数:expr
An unquoted variable name
一个非上市的变量名
参数: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=)被跟踪指定的环境,但应很少需要。
参数:list
A character vector of variable names to operate upon
字符向量的变量名来操作
参数:pattern
A regular expression specifying variable names to operate upon
正则表达式指定变量名来操作
参数:glob
A regular expression specifying variable names to operate upon
正则表达式指定变量名来操作
参数:all
If TRUE, operate upon all elegible variables
如果TRUE,操作后,所有elegible变量
参数:keep.in.db
If TRUE, the variable is left in the tracking database, though the link to it is broken (it becomes masked)
如果TRUE,该变量被留在跟踪数据库中被破坏,但链接的(它变成掩蔽)
参数:files
A vector of names of RData files (any file saved by save())
一个矢量的RDATA文件名(任何文件保存save())
参数:cache
TRUE or FALSE indicating whether to keep the tracked object cached in memory
TRUE或FALSE指示是否保持跟踪对象在内存中缓存
参数:clobber
TRUE or FALSE indicating whether to overwrite existing objects of the same name
TRUE或FALSE指示是否覆盖现有对象相同的名称
参数:time.of.file
If TRUE, use the access times on the file to populate the access time fields in the tracking summary.
如果TRUE,使用的文件的访问时间来填充的访问时间字段中的跟踪总结。
参数:warn
If TRUE, issue warnings about object not acted upon.
如果TRUE,发出警告对象不采取行动。
Details
详细信息----------Details----------
These functions are executed for their side effects:
执行这些功能对它们的副作用:
track: start tracking the specified variables
track:开始跟踪指定的变量
untrack: stop tracking the specified variables, leaving the object in envir so that it can still be used. If keep.in.db=TRUE, the variable is left in the tracking environment (but is masked), if keep.in.db=FALSE (the default), all trace of the variable is completely removed from the tracking environment.
untrack:停止跟踪指定的变量,离开该对象的envir所以它仍然可以使用。如果keep.in.db=TRUE,该变量被留在跟踪环境(但屏蔽),如果keep.in.db=FALSE(默认值),所有跟踪的变量是完全从跟踪环境。
track.remove: completely remove all traces of a tracked variable
track.remove:彻底清除所有痕迹跟踪的变量
track.save: write unsaved variables to disk
track.save:未保存的变量写入到磁盘
track.flush: write unsaved variables to disk, and remove from memory
track.flush:未保存的变量写入到磁盘,并从内存中删除
track.forget: delete cached versions without saving to file (file version will be retrieved next time the variable is accessed)
track.forget:删除缓存的版本,而不会保存到文件(文件版本将被检索下次访问该变量的时候)
track.restart: reload variable values from disk (can forget all cached vars, remove no-longer existing tracked vars)
track.restart:重装变量的值从磁盘(可以忘记所有的缓存瓦尔,删除没有已跟踪瓦尔“)
track.load: load variables from a saved RData file into the tracking session - if list is supplied, only these variables are loaded in. Already existing variables will be skipped and not overwritten unless clobber=TRUE is supplied. </ul>
track.load“:从一个跟踪会话保存的的RDATA文件到负载变量 - 如果list提供,仅这些变量被加载的。已经存在的变量将被跳过,不会被覆盖,除非clobber=TRUE提供。 </ ul>
值----------Value----------
The value returned from these functions is invisible and typically contains the names of objects acted upon.
从这些函数返回的值是不可见的,通常包含采取行动的对象的名称。
<table summary="R valueblock"> <tr valign="top"><td>track:</td> <td> a character vector containing the names of objects added to the tracking environment</td></tr> <tr valign="top"><td>untrack, track.remove, track.save, track.flush, track.forget, track.restart:</td> <td> a character vector containing the names of objects in the tracking environment that were acted upon</td></tr> <tr valign="top"><td>track.load:</td> <td> a list with two components:
<table summary="R valueblock"> <tr valign="top"> <TD> track:</ TD> <td>一个字符向量的对象添加到跟踪环境的名称</ TD> < / TR> <tr valign="top"> <TD> untrack, track.remove, track.save, track.flush, track.forget, track.restart: </ TD> <td>一个字符向量的名字对象的跟踪环境采取了行动</ TD> </ TR> <tr valign="top"> <TD> track.load: </ TD> <td>一个列表中有两个部分组成:
loaded:names of objects that were loaded from file
loaded:对象的名称,被加载file的
skipped:names of objects in file that were not loaded
skipped中的对象的名称file,未加载
</td></tr> </table>
</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Tony Plate <tplate@acm.org>
参见----------See Also----------
Overview and design of the trackObjs package.
trackObjs包的概述和设计。
实例----------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)
y1 <- 2
y2 <- 3
track(all=TRUE)
z1 <- 4
z2 <- 5
z3 <- 6
untracked()
track(list=c("z1", "z3"))
untracked()
track.summary(time=0, access=1, size=FALSE)
ls(all=TRUE)
track.stop()
ls(all=TRUE)
a <- 7
b <- 8
save(list=c("a", "b"), file="ab.rda")
remove(list=c("a", "b"))
track.start("tmp1")
track.summary(time=0, access=1, size=FALSE)
track.load("ab.rda")
track.summary(time=0, access=1, size=FALSE)
track.status()
track.stop()
unlink("tmp1", recursive=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|