track.options(trackObjs)
track.options()所属R语言包:trackObjs
Set and get tracking options on a tracked environment
在跟踪环境中设置和跟踪选项
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Set and get tracking options on a tracked environment. One independent set of tracking options exists for each tracked environment.
设置和跟踪选项跟踪的环境。存在一个独立的一套跟踪选项为每个跟踪环境。
用法----------Usage----------
track.options(..., pos = 1, envir = as.environment(pos), save = FALSE,
trackingEnv, only.preprocess = FALSE, old.options = list())
参数----------Arguments----------
参数:...
Either option names as character data, or specifications for setting options, as named arguments, or in a named list
无论是字符数据,或设置选项的规格,作为命名的参数,或命名列表中的选项名称
参数: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=)被跟踪指定的环境,但应很少需要。
参数:save
If TRUE, current options are saved to disk and will be used in future. Note that all current options settings are saved, not just the new settings made in this call.
TRUE如果,当前选项保存到磁盘,将用于在未来。请注意,目前所有的选项设置被保存,而不仅仅是新的设置,在这个调用。
参数:trackingEnv
The hidden environment in which tracked objects are stored. It is not necessary to supply this in normal use.
隐藏的存储环境中,跟踪对象。这是没有必要提供此在正常使用。
参数:only.preprocess
If TRUE, process any options specifications and return the full list of option settings with the values as specified, and defaults for all othe roptions. Stored options are neither accessed nor changed. Intended for internal use.
如果TRUE,处理任何购股权规格和选项设置的值,默认为所有的行吟诗人roptions返回的完整列表。存储选项既不是访问,也没有改变。供内部使用。
参数:old.options
A list of old options to use, can only be suppled when only.preprocess=TRUE. Intended for internal use.
列表使用的旧选项,只能suppled的only.preprocess=TRUE。供内部使用。
Details
详细信息----------Details----------
Valid option names and values are as follows:
有效的选项名称和值如下:
summaryTimes:logical, or integer value 0,1,2,3
summaryTimes:逻辑,或整数值0,1,2,3
summaryAccess:logical, or integer value 0,1,2,3,4
summaryAccess:逻辑,或整数值0,1,2,3,4
cache:logical (default TRUE) (keep written objects in memory?)
缓存:逻辑(默认为true)的(保持写内存中的对象吗?)
writeToDisk:logical (default TRUE) (always write changed objects to disk?)
writeToDisk:逻辑(默认TRUE)(总是写对象到磁盘?)
useDisk:logical (default TRUE) if FALSE, don't write anything – not implemented yet
usedisk配置:逻辑(默认为true)如果为FALSE,不写什么 - 尚未实现
recordAccesses:logical (default TRUE) if TRUE, record counts and times for access ("get") operations on tracked variables
recordAccesses:逻辑(默认为true)如果为TRUE,记录访问的次数和时间(“GET”)操作跟踪的变量
maintainSummary:logical (default TRUE) if TRUE, record time & number of accesses
maintainSummary:逻辑(默认为true)如果为true,记录时间和访问次数
alwaysSaveSummary:logical (default TRUE) if TRUE, always save the summary on any change
alwaysSaveSummary:逻辑(默认为true)如果为TRUE,一直保存摘要的任何变化
RDataSuffix:character (default "rda") suffix to use for files containing saved R objects
RDataSuffix字符(默认"rda")后缀使用的文件,其中包含保存的R对象
The option settings are saved as a list in an object called .trackingOptions in the tracking environment (with a copy mirrored to a file in the tracking dir if save=TRUE.)
选项设置保存为一个列表中一个名为.trackingOptions“在的跟踪环境(副本镜像到一个文件中的跟踪目录。如果save=TRUE。”)的对象
The options can be used to tune performance to resource availability (time & memory) and robustness in the face of machine or user error. Some possible settings are:
资源可用性(时间和记忆体)和鲁棒性,在面对计算机或用户错误可以用于调整性能的选项。一些可能的设置有:
maximize robustness and speed: cache=TRUE and writeToDisk=TRUE (the default): always write an object to disk when it is changed, and keep a copy in memory, so that an object only needs to be read once
最大限度地提高鲁棒性和速度:cache=TRUE和writeToDisk=TRUE(默认值):始终对象写入到磁盘时,它被改变,并保留一份副本在内存中,这样的对象只需要读取一次
minimize memory usage and maximize robustness: writeToDisk=TRUE, cache=FALSE: always write an object to disk when it is changed, and don't keep a copy in memory – need to read from disk whenever the object is referred to
最大限度地减少内存的使用情况,并最大限度地提高耐用性:writeToDisk=TRUE,cache=FALSE:总是写入到磁盘时,它被改变的对象,并没有在内存中保留一份副本 - 需要时从磁盘读取的对象是简称
maximize speed: writeToDisk=FALSE, cache=TRUE: don't write the object to disk - just keep a copy in memory after it is first accessed and only write it when track.stop() or one of track.save() or its friends is called. This combination less robust because changed variables can be lost if R crashes, or the user quits R without remembering to call track.stop(). This mode of operation is like the g.data package, but with automatically keeping track of which variables have been changed and need to be written to disk (and the writing of changed variables with one call to track.save() or track.stop()). The combination writeToDisk=FALSE and cache=FALSE is possible, but is unlikely to be desirable – this will keep changed objects in memory, but will not keep merely fetched objects in memory.
最大限度地提高速度:writeToDisk=FALSE,cache=TRUE:不写入到磁盘的对象 - 只是在内存中保留一份副本,这是第一次访问后,只写它的时候track.stop()或track.save()或称为它的朋友们。这样的组合不太可靠,因为改变的变量可能会丢失,如果R崩溃,或,用户退出R无记忆调用“track.stop()。这种操作模式是一样g.data包,但带有自动跟踪的变量已被更改,需要被写入到磁盘(和写作改变的变量,调用track.save()或 track.stop()“)。结合writeToDisk=FALSE和cache=FALSE是可能的,但不可能是可取的 - 这将让改变内存中的对象,但不会只取内存中的对象。
The options maintainSummary, recordAccesses, and alwaysSaveSummary control when the object summary is updated and when it is saved to disk (the default is for it to be updated and saved to disk for every read and write access to an object, whether or not the object is cached in memory).
的选项maintainSummary,recordAccesses和alwaysSaveSummary控制对象时,更新摘要,当它被保存到磁盘(默认情况下是被更新,并保存到磁盘上的每个读和写入访问的对象,不论对象是在内存中缓存)。
值----------Value----------
The value returned is a list of option values. If options were specified as arguments, the old values of those options are returned (unless only.preprocess=TRUE was supplied). If no options were specified as arguments, the full list of current option values is returned.
返回的值是一个列表的选项值。如果指定的选项,这些选项将返回旧的值作为参数(除非only.preprocess=TRUE提供)。如果没有指定的选项的完整列表,当前选项值作为参数,则返回。
(作者)----------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.status()
track.options(cache=TRUE, writeToDisk=FALSE) # change for just this session[改变只是这届]
# different ways of retrieving option values[不同的方式检索选项值]
track.options(c("cache", "writeToDisk"))
track.options("cache", "writeToDisk")
track.options("cache")
track.options()
track(X)
# see the effect of the changed options on the status of X (X is not saved to disk)[看到效果,更改的选项的状态的X(X不保存到磁盘)]
track.status()
X[1,1,1] <- 0
track.status()
track.flush()
track.status()
track.stop()
track.start("tmp1")
# note that options previously changed are back at defaults (because default[注意,以前更改的选项的默认值(因为默认]
# to track.options() is save=FALSE[track.options()保存= FALSE]
track.options(c("cache", "writeToDisk"))
track.options(cache=TRUE, writeToDisk=FALSE, save=TRUE) # change the options on disk[更改磁盘上的选项]
track.options(c("cache", "writeToDisk"))
track.stop()
track.start("tmp1")
# now options previously changed are remembered (because track.options(..., save=TRUE) was used)[以前更改的选项被记住(,因为track.options(...,节省= TRUE)使用)]
track.options(c("cache", "writeToDisk"))
track.stop()
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|