找回密码
 注册
查看: 303|回复: 0

R语言 trackObjs包 track.status()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:18:11 | 显示全部楼层 |阅读模式
track.status(trackObjs)
track.status()所属R语言包:trackObjs

                                        Return information about the status of tracking
                                         返回跟踪的状态信息

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Return information about the status of tracking in a particular environment.  Functions tell which variables are and which are not tracked, and whether objects exist in memory or in files.
返回的状态跟踪在特定的环境信息。功能告诉哪些变量,哪些是不被跟踪对象,以及是否存在于内存中,或在文件中。


用法----------Usage----------


track.status(pos = 1, envir = as.environment(pos), expr,
        qexpr = NULL, list = NULL, pattern = NULL, glob = NULL,
        file.status = TRUE, tracked = NA, reserved=FALSE,
        what = c("all", "tracked", "trackable", "untracked",
                 "orphaned", "masked", "unsaved", "untrackable"))
tracked(        pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)
untracked(      pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)
track.orphaned( pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)
track.masked(   pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)
untrackable(    pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)
track.unsaved(  pos=1, envir=as.environment(pos), list=NULL, pattern=NULL, glob=NULL)



参数----------Arguments----------

参数: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=)被跟踪指定的环境,但应很少需要。


参数:expr
An unquoted variable name
一个非上市的变量名


参数:qexpr
A variable name as an expression – not intended for use by end-users
一个变量名作为一个表达 - 不适合最终用户使用


参数:list
A character vector of variable names
字符向量的变量名


参数:pattern
A regular expression specifying variable names to operate upon
正则表达式指定变量名来操作


参数:glob
A regular expression specifying variable names to operate upon
正则表达式指定变量名来操作


参数:file.status
Check whether or not the file associated with a tracked object exists
检查相关的文件是否与跟踪目标存在


参数:tracked
If TRUE, return information only on tracked objects, if FALSE, return information only on objects that are not tracked, and if NA return information on all variables (subject to other filtering).
如果TRUE,返回的信息只有在被跟踪的对象,如果FALSE,返回的信息不被跟踪的对象,如果NA返回的信息的所有变量(其他过滤)。


参数:what
controls the information returned: "all" means return a data frame of status, other values means return a list of names of objects having that status
控制返回的信息:"all"是指返回数据框的状态,其他值意味着具有该状态的对象的名称返回一个列表


参数:reserved
If TRUE, include info about non-tracked variables with reserved names.  The default is to always omit these variables from the status summary.
如果TRUE,包括具有保留名称的非跟踪变量的信息。默认值是总是忽略这些变量的状态摘要。


Details

详细信息----------Details----------

These functions return information about the status of tracking on some or all variables in envir and the tracking environment. Tracking status depends on the relationship among three entities used for a tracked object:  
这些函数返回跟踪envir和跟踪环境中的部分或全部变量的状态信息。跟踪状态取决于用于跟踪对象的三个实体之间的关系:

the binding in envir which should be an active binding that refers to the tracking environment
,指的是跟踪环境中的绑定envir这应该是一个动态绑定

the cached object in the tracking environment
在跟踪环境缓存的对象

the corresponding disk file in the tracking directory
相应的磁盘文件中的跟踪目录

The arguments expr, list, pattern, and glob all serve to restrict the set of variables considered.
的参数expr,list,pattern和glob都可以用来限制组考虑的变量。


值----------Value----------

<table summary="R valueblock"> <tr valign="top"><td>track.status:</td> <td> returns a data.frame if what=="all", or a character vector otherwise.</td></tr> <tr valign="top"><td>track.dir:</td> <td> returns a single character string that is the full path to the directory where copies of objects are stored (the "tracking directory").</td></tr> <tr valign="top"><td>tracked, untracked, track.orphaned, track.masked, untrackable, track.unsaved:</td> <td> all return a character vector naming the variables with a particular status.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>:track.status: </ TD> <TD>返回一个data.frame如果what=="all",或字符向量否则。</ TD> </ TR> <tr valign="top"> <TD>track.dir: </ TD> <TD>返回一个字符串的目录的完整路径对象的副本存储(“跟踪目录”)。</ TD> </ TR> <tr valign="top"> <TD>tracked, untracked, track.orphaned, track.masked, untrackable, track.unsaved: </ TD> <TD>所有返回的字符向量命名的变量一个特定的状态。</ TD> </ TR> </ TABLE>


注意----------Note----------

These functions check whether the binding in envir is an active binding, but they cannot check whether the active binding has the correct function associated with it because R provides no mechanism for R-level access to the function associated with active bindings.
这些功能是否在envir的结合是一个积极的约束力,但是,他们不能检查是否有效绑定具有正确的功能与它相关联的,因为R没有提供R-级别的访问权限的功能与积极的绑定机制。


(作者)----------Author(s)----------


Tony Plate &lt;tplate@acm.org&gt;



参见----------See Also----------

Overview and design of the trackObjs package.
trackObjs包的概述和设计。


实例----------Examples----------


library(trackObjs)
unlink("tmp1", recursive=TRUE)
remove(list=ls(all=TRUE))
track.start("tmp1", cache=TRUE)
# with the standard options, create a variable with each status:[与标准的选项,创建一个变量,每一个状态:]
# "tracked", "trackable", "untracked", "orphaned", "masked", "unsaved"[“跟踪”,“可追踪”,“不露痕迹的”,“孤立”,“蒙面”,“未保存”]
# create some objects that are untrackable for various reasons[创建一些对象,是无法追踪的各种原因]
makeActiveBinding("uncoop", function(v) cat("I'm a binding that does nothing!\n"), globalenv())
.trackingFileMap <- "aren't I a mischevious little object :-)"
.trackingEnv <- "I simply can't be tracked!"
track(uncoop)
track(.trackingFileMap)
track(x1 <- 123)
track(x2 <- 456)
track(x3 <- 789)
track(x4 <- -321)
track(x5 <- -654)
x6 <- -987
track.status()
remove(list=c("x4", "x5"))
x5 <- "not tracked"
track.flush(x2)
track.status(reserved=TRUE)
track.options(writeToDisk=FALSE)
x3 <- 0
track.status()
track.save()
track.status()
x3 <- 1
track.status()
track.unsaved()
tracked()
untracked()
untrackable()
track.masked()
track.orphaned()
track.save(x3)
track.status()
# Test forgetting an unsaved variable[忘记一个未保存的变量进行测试]
x3
x3 <- 2
track.unsaved()
x3
track.forget(x3)
x3
# Test untracking a variable[测试untracking变量]
track.options(cache=FALSE)
x2
track.status()
bindingIsActive("x2", globalenv())
untrack(x2)
track.status()
bindingIsActive("x2", globalenv())
bindingIsActive("x3", globalenv())
untrack(x3, keep.in.db=TRUE)
track.status()
bindingIsActive("x3", globalenv())
# Try saving some objects to a file then loading them into the tracked environment[尝试某些对象保存到一个文件中,然后把它们装入的跟踪环境]
y1 <- 1
y2 <- "abc"
y3 <- list(2, "def")
save(list=c("y1", "y2", "y3"), file="tmpy.rda")
remove(list=c("y1", "y2", "y3"))
track.options(list(writeToDisk=TRUE, cache=TRUE))
track.status()
track.load("tmpy.rda")
unlink("tmpy.rda")
track.status()
y1
y2
y3
# See if the protection mechanisms against overwriting vars in[如果保护机制,对覆盖瓦尔]
# track.load work correctly.[track.load正常工作。]
y4 <- 4
y5 <- 5
save(list=c("y3", "y4", "y5"), file="tmpy.rda")
remove(list=c("y4"))
y3 <- "new value"
y3
track.load("tmpy.rda")
y3
track.status()
track.load("tmpy.rda", clobber=TRUE)
y3
y4
y5
track.stop()
unlink("tmp1", recursive=TRUE)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-30 10:29 , Processed in 0.019930 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表