Description Usage Arguments Examples
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.
1 | tableSummary(x, digits.mean = 2, digits.percentage = 0)
|
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.