grepFn(sos)
grepFn()所属R语言包:sos
Match pattern in a column of a matrix or data.frame
如同图案在一列中的矩阵或数据框
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Search for pattern in a column of a matrix or data.frame using grep. If value = TRUE (the default), return the selected subset of x.
搜索patterncolumn矩阵或数据框的使用grep。如果value= TRUE(默认值),返回选定的子集x。
用法----------Usage----------
grepFn(pattern, x, column='Function', ignore.case=FALSE,
perl=FALSE, value=TRUE, fixed=FALSE,
useBytes=FALSE, invert=FALSE)
参数----------Arguments----------
参数:x
a matrix or data.frame containing a column named column.
一个包含名为column一列的矩阵或数据框。
参数:pattern, ignore.case, perl, fixed, useBytes, invert
as for grep
grep
参数:column
character string giving the column of x in which to search for pattern.
字符串给列x的搜索pattern。
参数:value
logical: If TRUE, return the selected subset of x. If FALSE, return the row numbers returned by grep.
逻辑:如果为true,则返回选定的子集x。如果为FALSE,返回grep返回的行数。
Details
详细信息----------Details----------
1. g <- grep(pattern, x[, column])
1。 G < - grep的(图案,X [专栏])
2. if(value)return(x[g, ]) else return(g)
2。否则返回(值)([G])(G)
值----------Value----------
If(value) return an object of the same class as x containing those rows of x with x[, column] matching pattern.
如果(值)返回一个对象具有相同类的x包含x与x[, column]匹配pattern的那些行。
Else, return an integer vector identifying the rows of x with x[, column] matching pattern.
否则,返回的整数向量确定的行x与x[, column]匹配pattern。
(作者)----------Author(s)----------
Spencer Graves, Sundar Dorai-Raj
参见----------See Also----------
findFn grep
findFngrep
实例----------Examples----------
z <- cbind(a=1:2, Function=c('s', 'spline'))
z. <- grepFn("spline", z)
all.equal(z., z[2,,drop=FALSE])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|