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

Description Usage Arguments Examples

View source: R/common.R

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")                

mtconnectR documentation built on May 30, 2017, 4:15 a.m.

Search within the mtconnectR package
Search all R packages, documentation and source code