build_meta: Meta data builder

Description Usage Arguments Value

View source: R/build_meta.R

Description

creates a dataset that describes the characteristics of another dataset

Usage

1
2
3
4
5
6
build_meta(
  data,
  expand_binary_catgs = FALSE,
  add_perc_to_cats = TRUE,
  max_catgs = 10
)

Arguments

data

a data frame with any combination of the following attributes: label, unit, group, abbrs, and notes. Columns in the meta data are based on these attributes.

expand_binary_catgs

T/F, should all categories be included for binary categorical variables? (This only applies to binary variables.)

add_perc_to_cats

T/F, should categorical variables in Table 1 have a % sign following their label? Note that if the user specifies include_freq = TRUE in tibble_one, then the % symbol may be confusing to readers. However, when include_freq = FALSE, setting this to TRUE should clarify the table.

max_catgs

largest number of categories accepted in a factor variable. A warning message is printed if a factor variable has more categories than max_catg.

Value

A list containing components of data, group_levels, and var_levels. The data component comprises 8 columns:

data is also a tibble.

The group_levels component shows the order that groups will appear in the table, and var_levels shows the order that variables will appear in the table and within groups.


bcjaeger/tibbleOne documentation built on May 3, 2020, 3:56 p.m.