magic_table: Magic Table

Description Usage Arguments Details Value

View source: R/magic_table.R

Description

magic_table is the top-level function for magic_table_numeric and magic_table_categorical.

Usage

1
2
3
magic_table(dataset, vars, var_labels, cat_labels, stat_func, condvar_wide,
  condvar_wide_labels, condvar_long, condvar_long_labels, categorical = NULL,
  ...)

Arguments

dataset

a data.frame object, or object that can be coerced to a data.frame.

vars

a vector of character strings containing the names of the variables for which summary statistics should be computed.

var_labels

a vector of character strings containing the labels for the variables in vars.

cat_labels

a vector of character strings containing the labels for the categories of the variables contained in vars. If NULL (default), then cat_labels is constructed from the levels of vars.

stat_func

a function for calculating the summary statistics for the variables specified in vars.

condvar_wide

a character string indicating a variable in dataset for wide conditioning, i.e. within-group statistics are added as extra columns.

condvar_wide_labels

a character vector containing the labels for the different values of condvar_wide.

condvar_long

a character string indicating a variable in dataset for long conditioning, i.e. within-group statistics are added as extra rows.

condvar_long_labels

a character vector containing the labels for the different values of condvar_long.

categorical

a logical value indicating whether magic_table_categorical or magic_table_numeric should be called. If NULL (default), then magic_table wil automatically choose one based on the classes of vars.

...

additional variables to be passed to stat_func.

stat_labels

a vector of character strings containing the labels for the values in the output from stat_func.

Details

The main purpose of the magic_table function is to serve as a top-level function for calling either magic_table_numeric or magic_table_categorical. For convenience, magic_table will attempt to figure out which one should be called based on the classes of the variables contained in vars.

Value

a magic_table object, the result of a call to either magic_table_numeric or magic_table_categorical.


Scott-Coggeshall/magictable documentation built on July 30, 2020, 2:19 a.m.