grepRowNames: Get row names of data.frame matching a search string

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/extract.R

Description

Specify a character string and find the row names in a data.frame containing this character string.

Usage

1
grepRowNames(d.frame, part.name, ...)

Arguments

d.frame

data.frame

part.name

Search string in row names

...

Arguments passed to further functions

Details

Unlike using '==' or '%in%', here search is performed using grep() in a fashion of 'like', meaning substrings are recognized.

Value

Number and names of found row names.

Note

under continuous developement

Author(s)

Roland Rapold

References

none

See Also

grepColEntries grepColNames grepColNA grepObjNames grepNotCompleteEntries grepMultipleEntries grepColNegNum grepColFactors

Examples

1
2
3
4
5
6
7
if(require("MASS"))
{
    data(crabs, package="MASS")
    head(crabs)
    rownames(crabs) <- paste0("row_", rownames(crabs))
    print(grepRowNames(crabs, "16"))
}

rrMisc documentation built on June 25, 2021, 3 a.m.