grep_subset: Subset a data frame using regex matching on the column name...

Description Usage Arguments Examples

Description

Subset a data frame using regex matching on the column name and also on the value

Usage

1
grep_subset(dataFrame, colGrep, subGrep, echo = T, invert = F)

Arguments

dataFrame

is a data.frame

colGrep

is a regex pattern for finding the columns

subGrep

is a regex pattern to subset the values in the matched column

echo

If TRUE, messages are printed on the console

invert

If TRUE, returns everything other than the rows and columns matched using colGrep and subGrep

Examples

1
2
3
4
 
df = data.frame(type = c("sample","event","condition","sample"),value = c("value1","value2",
                 "value3","value4"))
filtered_df = grep_subset(df,"type","sample")                

systeminsights/mtconnectR documentation built on July 3, 2019, 1:37 p.m.