Description Usage Arguments Details Examples
View source: R/describe_data.r
describe_data
returns a set of common descriptive statistics
(e.g., n, mean, sd) for numeric variables.
1 | describe_data(data, ..., na.rm = TRUE)
|
data |
A data frame. |
... |
One or more unquoted (numerical) column names from the data frame, separated by commas. |
na.rm |
Logical. Should missing values (including NaN) be removed? |
The data set can be grouped using dplyr's group_by
so that descriptives will be calculated for each group level.
Skew and kurtosis are based on the skewness
and kurtosis
functions of the moments package (Komsta & Novomestky, 2015).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(dplyr)
# 1 variable
describe_data(cox, avoidance)
# 1 variable, 1 group
cox %>%
group_by(condition) %>%
describe_data(avoidance)
# 2 variables
describe_data(cox, avoidance, anxiety)
# 2 variables, 1 group
cox %>%
group_by(condition) %>%
describe_data(avoidance, anxiety)
# 1 variable, 2 groups
cox %>%
group_by(condition, sex) %>%
describe_data(avoidance)
# 2 variables, 2 groups
cox %>%
group_by(condition, sex) %>%
describe_data(avoidance, anxiety)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.