Skip to contents

Filter a PicnicHealth data set using a specified list of patients

Usage

filter_data_set(ds, person_ids, operation = "include")

Arguments

ds

A PicnicHealth data set list object.

person_ids

A vector of person ids.

operation

A character string indicating whether to include or exclude the person_id vector ("include" or "exclude"). Default is "include".

Value

A filtered PicnicHealth data set list object.

Details

If operation = "include", the default, filter_data_set() will subset all tables in the PicnicHealth data set list object, ds, to only rows associated with the vector of person_ids. If operation = "exclude", filter_data_set() will subset all tables in the PicnicHealth data set list object, ds, to remove any rows associated with the vector of person_ids.

See also

  • load_data_set() to load an entire directory of PicnicHealth data set tables as CSV files.

  • load_table() to load an individual PicnicHealth table and optionally specify data type conversions.

Examples

if (FALSE) { # \dontrun{
person_ids = c("aaa", "bbb", "ccc")

# Subset all tables to person_ids:
filtered_ds = filter_data_set(ds = ds, person_ids = person_ids, operation = "include")

# Remove person_ids from all tables:
filtered_ds = filter_data_set(ds = ds, person_ids = person_ids, operation = "exclude")
} # }