describe_data: Calculate common descriptive statistics

Description Usage Arguments Details Examples

View source: R/describe_data.r

Description

describe_data returns a set of common descriptive statistics (e.g., n, mean, sd) for numeric variables.

Usage

1

Arguments

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?

Details

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).

Examples

 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)

WillemSleegers/tidystats-v0.3 documentation built on Aug. 12, 2019, 5:31 p.m.