lcSuffix(Biobase)
lcSuffix()所属R语言包:Biobase
Compute the longest common prefix or suffix of a string
计算最长公共字符串的前缀或后缀
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions find the longest common prefix or suffix among the strings in a character vector.
这些功能发现的最长公共前缀或后缀字符向量的字符串之间。
用法----------Usage----------
lcPrefix(x, ignore.case=FALSE)
lcPrefixC(x, ignore.case=FALSE)
lcSuffix(x, ignore.case=FALSE)
参数----------Arguments----------
参数:x
a character vector.
字符向量。
参数:ignore.case
A logical value indicating whether or not to ignore the case in making comparisons.
一个逻辑值,指示是否忽略的情况下,在作比较。
Details
详情----------Details----------
Computing the longest common suffix is helpful for truncating names of objects, like microarrays, that often have a common suffix, such as .CEL.
计算最长共同后缀截断对象的名称是有帮助的,像芯片,往往有一个共同的后缀,如。CEL。
There are some potential problems with the approach used if multibyte character encodings are being used.
如果正在使用多字节字符编码使用的方法也有一些潜在的问题。
lcPrefixC is a faster implementation in C. It only handles ascii characters.
lcPrefixC是一个在C更快的实现,它只能处理ASCII字符。
值----------Value----------
The common prefix or suffix.
常见的前缀或后缀。
作者(S)----------Author(s)----------
R. Gentleman
参见----------See Also----------
nchar, nchar
nchar,nchar
举例----------Examples----------
s1 <- c("ABC.CEL", "DEF.CEL")
lcSuffix(s1)
s2 <- c("ABC.123", "ABC.456")
lcPrefix(s2)
CHK <- stopifnot
CHK(".CEL" == lcSuffix(s1))
CHK("bc" == lcSuffix(c("abc", "333abc", "bc")))
CHK("c" == lcSuffix(c("c", "abc", "xxxc")))
CHK("" == lcSuffix(c("c", "abc", "xxx")))
CHK("ABC." == lcPrefix(s2))
CHK("ab" == lcPrefix(c("abcd", "abcd123", "ab", "abc", "abc333333")))
CHK("a" == lcPrefix(c("abcd", "abcd123", "ax")))
CHK("a" == lcPrefix(c("a", "abcd123", "ax")))
CHK("" == lcPrefix(c("a", "abc", "xxx")))
CHK("ab" == lcPrefixC(c("abcd", "abcd123", "ab", "abc", "abc333333")))
CHK("a" == lcPrefixC(c("abcd", "abcd123", "ax")))
CHK("a" == lcPrefixC(c("a", "abcd123", "ax")))
CHK("" == lcPrefixC(c("a", "abc", "xxx")))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|