replaceVectorByEquality(ddCt)
replaceVectorByEquality()所属R语言包:ddCt
REPLACE ITEMS OF VECTOR BY EQUALITY
平等向量取代项目
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function replces (or updates) the items of a given vector by checking the equality with the target parameter. If found, the item will be replaced by the value parameter. The length of both target and value must be the same and could be longer than 1, in which case the replace will be iterated.
(或更新)的功能replces一个给定的向量通过检查target参数与平等的项目。如果发现,该项目将取代value参数。两者的长度target和value必须是相同的,并且可能超过1,在这种情况下,将迭代替换。
用法----------Usage----------
replaceVectorByEquality(vector, target, value)
参数----------Arguments----------
参数:vector
A vector to be replaced. The items of the vector must be atom types, since the equality is checked by '=='.
一个被替换的向量。向量的项目必须是原子类型,因为平等是==检查。
参数:target
targets to be replaced, could be either single or a vector
被替换的目标,可以是单一或一个向量
参数:value
values to be replaced at the positions of targets, must be of the same length of target
要在目标位置取代的价值,必须是相同长度的target
Details
详情----------Details----------
A warning will be prompted if any item in the target cannot be found
会提示警告,如果无法找到任何target项目
值----------Value----------
A vector of the same length as the parameter vector
作为参数vector相同长度的向量
作者(S)----------Author(s)----------
Jitao David Zhang
参见----------See Also----------
== for checking equality.
==检查平等。
举例----------Examples----------
vector <- c("java", "perl", "python", "c#")[“)]
replaceVectorByEquality(vector, target="c#", value="c/c++")[“值=”C / C +“)]
replaceVectorByEquality(vector, target=c("c#","perl"), value=c("c/c++","R"))[“,”perl“的),价值= C(”C / C +“,”住宅“))]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|