View source: R/applyFilterCriteria.R
applyFilterCriteria | R Documentation |
Details about criteria applied and number of rows matching each criterion
is returned in the attribute "details.filter". If a criterion evaluates to
NA
, the corresponding row in the data frame is removed (just as if the
criterion evaluated to FALSE
).
applyFilterCriteria(x, criteria = NULL, lengthColumn = NULL, ...)
x |
data frame |
criteria |
vector of character defining filter criteria to be evaluated in x |
lengthColumn |
name of the column containing lengths, e.g. "Length_raw" |
... |
passed to |
# Create a very simple data frame df <- data.frame(value = 1:10, group = rep(c("a", "b"), 5)) # Show the data frame df # Filter for rows meeting two criteria result <- applyFilterCriteria(df, c( "value is below or equal to 5" = "value <= 5", "group is 'a'" = "group == 'a'" )) # Show the result result # Get the evaluation of each criterion in columns kwb.utils::getAttribute(result, "matches")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.