apply_filter: Apply a Filter to a Dataset or List of Datasets

View source: R/filters.R

apply_filterR Documentation

Apply a Filter to a Dataset or List of Datasets

Description

Apply a Filter to a Dataset or List of Datasets

Usage

apply_filter(data, ...)

## Default S3 method:
apply_filter(data, ...)

## S3 method for class 'data.frame'
apply_filter(data, id, target = deparse(substitute(data)), verbose = TRUE, ...)

## S3 method for class 'list'
apply_filter(data, id, verbose = TRUE, ...)

Arguments

data

data.frame of list of data.frames

...

Not used.

id

character. The ID of a filter defined with add_filter()

target

character. The name of the dataset, e.g. ADSL or ADTTE

verbose

logical. Should informative messages be printed? Defaults to TRUE.

Value

A new data.frame or list of data.frames filtered based upon the condition defined for id

Author(s)

Thomas Neitmann (neitmant)

Examples

adsl <- random.cdisc.data::cadsl
adae <- random.cdisc.data::cadae
datasets <- list(adsl = adsl, adae = adae)

add_filter("REL", "Related AEs", "ADAE", AEREL == "Y", overwrite = TRUE)

apply_filter(adsl, "SE")
apply_filter(adae, "SER_REL")
apply_filter(datasets, "SER_REL_SE")


filters documentation built on May 29, 2024, 8:29 a.m.