Store(SOAR)
Store()所属R语言包:SOAR
Store objects out of memory in a stored object cache.
存储对象的内存在存储对象缓存。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions take objects in memory and store them on the disc in a directory we call a “stored object cache”. The objects remain visible and are brought back into memory as required using the same mechanism as is used for lazy loading in packages. If the stored object cache does not already exist it is created. If it is not already attached to the search path it is silently attached.
这些函数在内存中的对象,并将其存储光盘上的一个目录中,我们所说的“存储对象缓存”。的对象保持可见和被带回使用相同的机制,用于封装的延迟加载到内存中。如果存储的对象高速缓存不存在,则创建它。如果尚未连接到搜索路径中,它被悄悄连接。
用法----------Usage----------
Store(..., list = character(0),
lib = Sys.getenv("R_LOCAL_CACHE", unset = ".R_Cache"),
lib.loc = Sys.getenv("R_LOCAL_LIB_LOC", unset = "."),
remove = TRUE)
StoreData(...)
StoreUtils(...)
参数----------Arguments----------
参数:...
items to be removed. Names are taken as objects to be removed. Character strings, or calls resulting in character strings, are taken as providing names of items to be removed as character strings.
资料被删除。名称取为要删除的对象。字符串,或在字符串中的检测,提供的项目名称被删除字符串。
参数:list
a character string vector providing the names of objects to be removed. An alternative to ... allowing the user to provide an explicit list of names.
提供要删除的对象的名称的字符串矢量。 ...允许用户提供一个明确的名称列表的一种替代方法。
参数:lib
The name of the cache directory from which items are to be removed. May be given as a character string, or as a name, (i.e. without quotes) for convenience. The default is as follows:
从该件的高速缓存目录的名称被删除。可能被指定为一个字符串,或作为一个名字,(即不带引号),为方便起见。缺省值是如下:
For Store, the value of the R environment variable R_LOCAL_CACHE, or .R_Cache if unset,
对于Store,R环境变量R_LOCAL_CACHE或.R_Cache,如果取消设置的值,
For StoreData, the value of the R environment variable R_CENTRAL_DATA, or .R_Data if unset,
对于StoreData,R环境变量R_CENTRAL_DATA或.R_Data,如果取消设置的值,
For StoreUtils, the value of the R environment variable R_CENTRAL_UTILS, or .R_Utils if unset.
对于StoreUtils,R环境变量R_CENTRAL_UTILS或.R_Utils,如果取消设置的值。
参数:lib.loc
The enclosing directory where the cache directory is to be found. The default is as follows:
封闭目录的缓存目录被发现。缺省值是如下:
For Store, the value of the R environment variable R_LOCAL_LIB_LOC, or the current working directory if unset,
Store,R环境变量的值的R_LOCAL_LIB_LOC,或当前的工作目录,如果取消设置,
For StoreDate and StoreUtils the value of the R environment variable R_CENTRAL_LIB_LOC, or he user's HOME directory if unset.
参数:remove
Logical. Should the objects be removed from the current environment? Normally this would be the case.
逻辑。如果被删除的对象,从目前的环境呢?通常情况下,这会出现这种情况。
Details
详细信息----------Details----------
These functions take objects currently in memory and store them as .RData files in a special directory on the disc, normally a sub-directory of the present working directory. We call the directory a “stored object cache”. The objects are then made visible by attaching an environment to the search path which loads the file on demand using essentially the lazy loading technique. The path of the stored object cache is specified in two parts, the lib.loc giving the path of the parent directory and the lib, giving the name of the directory iteself. This is the same protocol as is used for loading packages using library or require, for example.
这些功能目前在内存中的对象,并将其储存.RData文件在光盘上的一个特殊的目录,通常是当前工作目录的子目录。我们的目录称为“存储对象缓存”。的对象是可见的环境连接到搜索路径中加载该文件本质上是使用延迟加载技术的需求。中指定的存储对象高速缓存的路径两部分,lib.loc给予的父目录的路径和lib,给目录iteself的名称。这是用于装载包library或require,例如相同的协议。
值----------Value----------
Nothing of interest. Used only for its side effect.
没有什么兴趣。仅用于其副作用。
注意----------Note----------
If the cache is not presently attached to the search path, it is sliently attached at postion 2 before objects are removed from it.
如果缓存没有目前的搜索路径,它是sliently连接对象被删除前,从现在的位置是2。
Old caches made in pre-release versions of SOAR (known as ASOR) will be converted to the present format with a warning that this is happening. After this conversion only the current version of the package may be used to access the cached objects.
旧高速缓存的预发布版本的SOAR(称为ASOR)将被转换为目前的形式,这是发生警告。这个转换后只对当前版本的包可以用来访问缓存对象。
(作者)----------Author(s)----------
Bill Venables
参考文献----------References----------
参见----------See Also----------
save, load.
save,load。
实例----------Examples----------
## change default cache, keeping any previous setting[#更改默认的缓存,保持所有以前的设置]
oldLC <- Sys.getenv("R_LOCAL_CACHE", unset = ".R_Cache")
Sys.setenv(R_LOCAL_CACHE=".R_Test")
## generate some dummy data[#生成一些虚拟的数据。]
dummy <- rnorm(100)
mn <- mean(dummy)
va <- var(dummy)
## store it in the stored object cache[#存储中存储的对象缓存]
Store(dummy, mn, va)
Search()
Objects()
Remove(mn, va)
Objects()
Remove(Objects()) # empty the cache[清空缓存]
detach(".R_Test") # remove from search path[从搜索路径中删除]
Sys.setenv(R_LOCAL_CACHE=oldLC) # restore normal default[恢复正常默认]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|