mixNamedVec(simecol)
mixNamedVec()所属R语言包:simecol
Mix Two Named Vectors, Resolving Name Conflicts
混合两种命名的向量,解决名称冲突
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function mixes two named vectors. The resulting vectors contains all elements with unique name and only one of the two versions of the elements which have the same name in both vectors.
功能混合两个命名的向量。将所得的向量包含具有独特的名称和只有一个的两个版本的两种向量中具有相同的名称的元素的所有元素。
用法----------Usage----------
mixNamedVec(x, y, resolve.conflicts = c("x", "y"), warn = TRUE)
参数----------Arguments----------
参数:x
first named vector,
第一个命名为向量,
参数:y
second named vector,
第二命名为向量,
参数:resolve.conflicts
name of the vector from which all elements are taken,
采取从所有元素的矢量的名称,
参数:warn
an indicator if a warning should be given if elements are not unique. This argument should usually set to FALSE, but the default is TRUE to be on the safe side.
如果元素不是唯一的,应给予警告指示器,如果。通常,这个参数应该设置为FALSE,但默认值是true是在安全方面。
值----------Value----------
a vector with all elements from one vector and only these elements of the second, that have a unique name not contained in the other vector.
从一个向量的所有元素,这些元素中的第二,有一个唯一的名称不包含在其他向量的向量。
(作者)----------Author(s)----------
Thomas Petzoldt
参见----------See Also----------
which
which
实例----------Examples----------
x <- c(a=1, b=2, c=3)
y <- c(a=1, b=3, d=3)
mixNamedVec(x, y)
mixNamedVec(x, y, resolve.conflicts="x")
mixNamedVec(x, y, resolve.conflicts="x", warn=FALSE)
mixNamedVec(x, y, resolve.conflicts="y", warn=FALSE)
## without names, returns vector named in "resolve conflicts"[#没有名字,“解决冲突”的回报向量]
x <- as.vector(x)
y <- as.vector(y)
mixNamedVec(x, y)
mixNamedVec(x, y, resolve.conflicts="y")
## names partly[#名称部分]
x <- c(4, a=1, b=2, c=3, 4, 9)
y <- c(a=1, 6, b=3, d=3, 8)
mixNamedVec(x, y)
mixNamedVec(x, y, resolve.conflicts="y")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|