condMultiFilter: Conditionally filter a data frame by multiple regex's

Description Usage Arguments Value Author(s)

Description

Filter (subset) a data frame by a vector rgx of regular expressions applied to a specified column of the data frame. The filter is essentially 'rgx[1] | rgx[2] | ... rgx[N]'. Filtering is conditional, in that if the argument rgx is NULL, the dataframe is returned unchanged.

Usage

1
condMultiFilter(dfr, col, rgx, ...)

Arguments

dfr

the data frame to be filtered/subsetted

col

character: the name of the column of the data frame to which filtering is to be applied.

rgx

a character vector of regular expressions. Remember that the character strings are parsed by the R interpreter before being parsed by the regular expression parser, so backslashes must be 'doubled up'.

...

other arguments to be passed to grepl.

Value

A data frame.

Author(s)

Alexander Zwart (alec.zwart at csiro.au)


aleczwart/scriptmapr documentation built on May 11, 2019, 11:23 p.m.