rvattach(rv)
rvattach()所属R语言包:rv
Attach components of rv objects to search path
附加组件RV对象搜索路径
译者:生物统计家园网 机器人LoveR
描述----------Description----------
rattach works like attach but removes objects from .GlobalEnv that have conflicting names; optionally can also impute vector components by name into the object that is in .GlobalEnv (copying the imputed object into the attached list. rvattach first splits a named vector into a list, and then uses rattach to attach them to the search path.
rattachattach但.GlobalEnv有冲突的名称中删除对象,也可以有选择地归咎于矢量分量的名字是.GlobalEnv(复制的估算对象到对象所附列表。rvattach第一次将一个命名矢量成一个列表,然后使用rattach附加的搜索路径。
用法----------Usage----------
rattach(what, name=deparse(substitute(what)), overwrite=TRUE, impute=FALSE, ...)
rvattach(what, name=deparse(substitute(what)), overwrite=TRUE, impute=FALSE, ...)
参数----------Arguments----------
参数:what
an rv object to be split up into a list of sub-vectors and attached
随机变量对象被分割成子矢量的列表并附着
参数:name
name to use for the attached database. All databases with the exact same name in the search path are removed first.
为所连接的数据库名称使用。所有的数据库的名称完全相同的搜索路径中,首先被清除。
参数:overwrite
If TRUE, objects with identical names in the workspace (.GlobalEnv) that are masking objects in the database to be attached will be deleted.
如果TRUE,将被删除对象具有相同的名称,屏蔽被连接在数据库中的对象在工作区中(.GlobalEnv)。
参数:impute
If TRUE, the components of each sub-vector are imputed into the object with identical name in the workspace and saved into the list. The object in the workspace is not affected (unless overwrite=TRUE).
如果TRUE,每个子矢量的组件被插补到在工作区中具有相同名称的对象,并保存到列表中。在工作区中的对象不会受到影响(除非overwrite=TRUE“)。
参数:...
further arguments passed to attach
进一步的参数传递给attach
Details
详细信息----------Details----------
rvattach takes an rv object, splits it up into a list of sub-vectors (using split.rv) by their name attributes and attaches the list to the search path. For example, if the object to be processed has names x[1] and y[3], this will be split into a list of two sub-vectors, x and y, and then attached.
rvattach需要的RV对象,将它放入一个列表中的子向量(使用split.rv),其name属性和列表中的搜索路径。例如,如果要被处理的对象的名称x[1]和y[3],这将被分割到一个列表中的两个子向量,x和y,然后连接。
If the option impute is TRUE, the corresponding variables with the same names are merged with the ones that are found in .GlobalEnv, and copied into the database.
如果该选项归罪于TRUE,相应的变量具有相同名称的合并,那些被发现在.GlobalEnv,并复制到数据库中。
If the option overwrite is TRUE, the objects with identical names in the Workspace are deleted.
如果选择覆盖TRUE,在工作区中的对象具有相同的名称将被删除。
All databases with the exact same name in the search path are removed first.
所有的数据库的名称完全相同的搜索路径中,首先被清除。
(作者)----------Author(s)----------
Jouni Kerman
<a href="mailto:jouni@kerman.com">jouni@kerman.com</a>
参考文献----------References----------
Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
实例----------Examples----------
# Trying rattach:[试图rattach:]
x <- rvnorm(9)
names(x) <- paste("theta[", 1+seq_along(x), "]", sep="")
L <- list(x=x)
x <- 1:10
rattach(L, impute=TRUE) # attaches a list called 'L' containing an object 'x'[附加一个叫做L对象X]
print(x)
detach("L")
exists("x") # FALSE[FALSE]
# Trying rvattach:[试图rvattach:]
rvattach(L$x) # attaches a list 'rvattach' containing an object 'theta'[高度的名单“rvattach包含一个对象的THETA]
print(theta)
rvattach() # Detaches the list 'rvattach'[分离列表“rvattach”]
exists("theta") # FALSE[FALSE]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|