describe_data: Calculate common descriptive statistics

View source: R/describe_data.r

describe_dataR Documentation

Calculate common descriptive statistics

Description

describe_data() returns a set of common descriptive statistics (e.g., number of observations, mean, standard deviation) for one or more numeric variables.

Usage

describe_data(data, ..., na.rm = TRUE, short = FALSE)

Arguments

data

A data frame.

...

One or more unquoted column names from the data frame.

na.rm

A boolean indicating whether missing values (including NaN) should be excluded in calculating the descriptives? The default is TRUE.

short

A boolean indicating whether only a subset of descriptives should be reported? If set to ⁠TRUE``, only the N, M, and SD will be returned. The default is ⁠FALSE'.

Details

The data can be grouped using dplyr::group_by() so that descriptives will be calculated for each group level.

Skew and kurtosis are based on the datawizard::skewness() and datawizard::kurtosis() functions (Komsta & Novomestky, 2015).

Examples

describe_data(quote_source, response)

describe_data(quote_source, response, na.rm = FALSE)

quote_source |>
  dplyr::group_by(source) |>
  describe_data(response)

quote_source |>
  dplyr::group_by(source) |>
  describe_data(response, short = TRUE)


tidystats documentation built on Oct. 17, 2023, 1:06 a.m.