magic_table_categorical: Magic Table

Description Usage Arguments Value

View source: R/magic_table.R

Description

magic_table_categorical creates a magic table object from a data.frame-type object when the input variables are a set of categorical variables.

Usage

1
2
3
magic_table_categorical(dataset, vars, var_labels = NULL, cat_labels = NULL,
  stat_func, stat_labels, condvar_wide = NULL, condvar_wide_labels = NULL,
  condvar_long = NULL, condvar_long_labels = 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.

Value

a list containing tables of summary statistics for the specified variables.


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