Calculates numeric statistics of data

stats_numeric(
  data,
  ...,
  stats_to_calculate = NULL,
  .select_function = is.numeric
)

Arguments

data

A data frame to process.

...

Grouping variables to be applied before calculation.

stats_to_calculate

List of statistics function to calculate. Default value is NULL which means that standard functions (n, mean, sd, median, iqr, min and max) are calculate.

.select_function

Function used to select data columns for which the stats will be calculated. Default value is is.numeric.

Value

Data frame containing stats.

Examples

library(ggplot2)
library(dplyr)
data("diamonds")
ds_stats <- stats_numeric(diamonds)
stats_to_calculate <- list(n = ~ n(), mean = ~ mean(.x, na.rm = TRUE), sd = ~ sd(.x, na.rm = TRUE))
ds_stats <- stats_numeric(diamonds, stats_to_calculate = stats_to_calculate)