Description Usage Arguments Examples
Subset a data frame using regex matching on the column name and also on the value
1 | grep_subset(dataFrame, colGrep, subGrep, echo = T, invert = F)
|
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 |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.