tableSummary: Summary Table

Description Usage Arguments Examples

View source: R/z_deprecated.R

Description

This function summarizes numerical and dichotomous variables only. The summary number is either the mean of a numeric variable for the number and percentage of values that are the second of the two factors in a dichotomous variable. Missing values are removed before the summary statistic is calculated and the numer of missing observations is also presented in the table.

Usage

1
tableSummary(x, digits.mean = 2, digits.percentage = 0)

Arguments

x

Vector of data which to summarize. Should be used for numerical and dichotomous variables only.

digits.mean

The mean is rounded and displayed using this many digits.

digits.percentage

The percentage is rounded and displayed using this many digits.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
X <- data.frame('some.continuous'=runif(300),'some.factor'=factor(rbinom(300,1,0.3)))
tableSummary(X$some.continuous)
# use CBapply to create a table
CBapply(X,tableSummary)
# specify the digits differently to change the display of the table
CBapply(X,tableSummary,digits.mean=3,digits.percentage=2)

## End(Not run)

cole-brokamp/CB documentation built on May 13, 2019, 8:49 p.m.