grepColEntries: Subset of data.frame containing string

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

View source: R/extract.R

Description

Get a subset of a data.frame with specified string in a given column.

Usage

1
grepColEntries(d.frame, col.name, part.name, ...)

Arguments

d.frame

data.frame

col.name

Name of column

part.name

Search string in column names

...

Arguments passed to further functions

Details

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

Value

Subset of data.frame for which selection conditions are met.

Note

under continuous developement

Author(s)

Roland Rapold

References

none

See Also

grepColNames grepColNA grepObjNames grepNotCompleteEntries grepMultipleEntries grepRowNames grepColNegNum grepColFactors

Examples

1
2
3
4
5
6
if(require("MASS"))
{
    data(crabs, package="MASS")
    print(head(grepColEntries(crabs, "sex", "M")))
    print(head(grepColEntries(crabs, "index", "2")))
}

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