grepColNames: Get column 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 column names in a data.frame containing this character string.

Usage

1
grepColNames(d.frame, part.name, sort.col = "nr", ...)

Arguments

d.frame

data.frame

part.name

Search string in column names

sort.col

specify output column to sort by

...

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

grepColNames() returns the found column names and details

Note

under continuous developement

Author(s)

Roland Rapold

References

none

See Also

grepColEntries grepColNA grepObjNames grepNotCompleteEntries grepMultipleEntries grepRowNames grepColNegNum grepColFactors

Examples

1
2
3
4
5
6
7
if(require("MASS"))
{
    data(crabs, package="MASS")
    head(crabs)
    print(grepColNames(crabs, "W"))
    print(grepColNames(crabs, "e"))
}

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