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

R语言 SOAR包 Attach()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 11:20:59 | 显示全部楼层 |阅读模式
Attach(SOAR)
Attach()所属R语言包:SOAR

                                         Attach object cache
                                         将对象缓存

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

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

Place a stored object cache one the search path, or change the position of such a cache already on the search path.
将存储对象缓存的搜索路径,或改变这样的缓存已经在搜索路径的位置。


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


Attach(lib = Sys.getenv("R_LOCAL_CACHE", unset = ".R_Cache"),
       lib.loc = Sys.getenv("R_LOCAL_LIB_LOC", unset = "."),
       pos = 2, uniquely = TRUE, readonly = FALSE, ...)
AttachData(...)
AttachUtils(...)



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

参数: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 Attach, the value of the R environment variable R_LOCAL_CACHE, or .R_Cache if unset,  
对于Attach,R环境变量R_LOCAL_CACHE或.R_Cache,如果取消设置的值,

For AttachData, the value of the R environment variable R_CENTRAL_DATA, or .R_Data if unset,  
对于AttachData,R环境变量R_CENTRAL_DATA或.R_Data,如果取消设置的值,

For AttachUtils, the value of the R environment variable R_CENTRAL_UTILS, or .R_Utils if unset.  
对于AttachUtils,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 Attach, the value of the R environment variable R_LOCAL_LIB_LOC, or the current working directory if unset,  
Attach,R环境变量的值的R_LOCAL_LIB_LOC,或当前的工作目录,如果取消设置,

For AttachDate and AttachUtils the value of the R environment variable R_CENTRAL_LIB_LOC, or he user's HOME directory if unset.  
对于AttachDate和AttachUtilsR环境变量的值的R_CENTRAL_LIB_LOC,或用户的HOME目录,如果取消设置。


参数:pos
The position on the search path where the object cache is to be placed, or the new position if the cache is already on the search path.  
的搜索路径将被放置在缓存中的对象,或新的位置,如果缓存已经在搜索路径上的位置。


参数:uniquely
Logical. Are multiple copies of the same cache on the search path to be disallowed?  If TRUE, a single copy only is left on the search path.  
逻辑。的多个副本相同的高速缓存上的搜索路径是不允许的吗?如果TRUE,一个单一的副本只上留下的搜索路径。


参数:readonly
Logical.  If TRUE modifications to the objects in the cache are prevented.  
逻辑。如果TRUE修改缓存中的对象是可以避免的。


参数:...
Extra arguments to be passed on to internal SOAR functions. Presently unused.  
额外的参数被传递给内部SOAR功能。目前未使用。


Details

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

An existing object cache is attached to the search path.  If the object cache directory, file.path(lib.loc, lib), currently does not exist a warning is issued to that effect, but also advising that the directory will be created when an object is to be Stored there.
连接到现有的对象缓存的搜索路径。如果对象缓存目录,file.path(lib.loc, lib),目前不存在会发出一个警告效果,但也建议该目录将被创建一个对象时是Stored有。


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

Nothing of interest.  The function is used solely for its side-effect on the search path
没有什么兴趣。该函数只用于搜索路径上的其副作用


注意----------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)将被转换为目前的形式,这是发生警告。这个转换后只对当前版本的包可以用来访问缓存对象。


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

This function is not often needed, as any of the other main functions, (Store, Objects, Remove and their variants), will automatically attach the object cache if required to do so.  A common use is to change the position of a currently attached object cache on the search path.
这个功能是不是经常需要任何的其他主要功能,(Store,Objects,Remove和它们的变体),将自动连接缓存中的对象,如果要求这样做。一个常见的用途是改变当前连接的对象高速缓存上的搜索路径的位置。

To release an object cache from the search path, use the standard function detach.
从搜索路径中要释放的对象缓存,使用标准的功能detach。


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



Bill Venables




参考文献----------References----------



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

attach, detach.
attach,detach。


实例----------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)

Attach()                            # may give warning[可能会发出警告]

## store it in the stored object cache[#存储中存储的对象缓存]
Store(dummy, mn, va)
Search()

Attach(pos=3)                       # change to pos=3[切换到pos = 3]
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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 00:29 , Processed in 0.030114 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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