apply_filter: Apply a filtering criterion

Description Usage Arguments Value Examples

View source: R/apply_filter.R

Description

Apply a filtering criterion

Usage

1
apply_filter(d, var, values)

Arguments

d

input data frame.

var

variable name (as a quoted character string).

values

vector of values used as filtering criterion: for qualitative variables, a vector of valid values; for quantitative variables, the valid range.

Value

A data frame, comprising only the subset of rows of the input data frame that match the filter.

Examples

1
2
3
4
5
summary(ctd)
summary(apply_filter(ctd, "month", c("Mar", "Apr", "May")))
hist(ctd$sal, breaks=100)
ctd_clean <- apply_filter(ctd, "sal", c(37.7, 38.4))
hist(ctd_clean$sal, breaks=100)

jiho/qualitr documentation built on July 9, 2020, 12:49 a.m.