Description Usage Arguments Details Examples
count_data
returns the number of observations for categorical
variables.
1 | count_data(data, ..., na.rm = TRUE)
|
data |
A data frame. |
... |
One or more unquoted (categorical) column names from the data frame, separated by commas. |
na.rm |
Logical. Should missing values (including NaN) be removed? |
The data frame can be grouped using dplyr's group_by
so that the total of observations will be calculated for each group level.
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr)
# 1 variable
count_data(cox, sex)
# 2 variables
count_data(cox, condition, sex)
# 1 variable, 1 group
cox %>%
group_by(condition) %>%
count_data(sex)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.