post_reduce_cols: Subset columns from processed ACE/SEA modules

post_reduce_colsR Documentation

Subset columns from processed ACE/SEA modules

Description

User-friendly wrapper to choose demographics and selected outcome variables from ACE/SEA data processed with proc_by_module.

Usage

post_reduce_cols(
  df,
  demo_names = c("pid", "age", "grade", "gender"),
  metric_names = c(),
  metric_names_exclude = c()
)

Arguments

df

a df, output by proc_by_module, containing processed ACE or SEA data.

demo_names

a character vector containing the names of demographic columns to include in the output. Column names will be matched exactly.

metric_names

a character vector containing partial names of metric columns to include in the output. All column names containing any of the inputs will be included in output.

metric_names_exclude

a character vector containing partial names of metric columns to exclude from the output. All column names containing any of the inputs will be excluded from output. This argument supersedes the prior, so any columns matching both a partial name from metric_names and a partial name from metric_names_exclude will be excluded.

Value

a df, similar in structure to proc, but containing only the subsetted columns.


josegallegos07/aceR documentation built on July 19, 2024, 6:32 p.m.