filterContain: filterContain()

Description Usage Arguments Value Note Examples

View source: R/helper_functions.R

Description

Table function: filter a df by column contains a list of specified values

Usage

1
filterContain(df, column, value, verbose = F, ...)

Arguments

df

A data.frame to be filtered

column

(str) column to be filtered

value

(str list) a list of strs to match with the value column. If a match is found, the record is returned

verbose

[optional] (bool) print if a match is found, and how many records returned. default = F

...

more parameters in the grepl() function, eg. ignore.case = T

Value

A data.frame with matched records, including empty df if no match is found

Note

only to match the full words in the list (if the value contains two or more, it is a match)

Examples

1
2
3
4
5
filterContain(df, column, value, verbose = F, ...)

 filter a df by column contains a list of specified values
 only to match the full words in the list (if the value contains two or more, will match)
 ... more parameters in the grepl() function, eg. ignore.case = T

BerylZhuang/helper_functions documentation built on March 15, 2021, 5:19 a.m.