summary_num: Summary of a numeric variable

View source: R/summary_num.r

summary_numR Documentation

Summary of a numeric variable

Description

Summary statistics for numeric variables.

Usage

summary_num(
  x,
  type = FALSE,
  other_means = FALSE,
  skewness = FALSE,
  kurtosis = FALSE
)

Arguments

x

A numeric vector

type

A boolean value, if TRUE the function will add metrics related to the variables type (default = TRUE)

other_means

A boolean value, if TRUE the function will add the harmonic and geometric means (default = FALSE)

skewness

A boolean value, if TRUE the function will add the skewness coefficients (default = FALSE)

kurtosis

A boolean value, if TRUE the function will add the kurtosis coefficients (default = FALSE)

Details

By default the summary statistics are:
- min: the minimum;
- p25: the first quartile;
- p50: the second quartile (median);
- p75: the third quartile;
- max: the maximum;
- mode: the peak density value;
- mean: the mean;
- cv: the coefficient of variation.

If 'type' = TRUE, the following metrics will be added:
- n: the number of observations;
- na: the number of missing values;
- negative: the number of negative values;
- equal_zero: the number of values equal to zero;
- positive: the number of positive values.

If 'other_means' = TRUE, the following metrics will be added:
- geometric_mean: the geometric mean;
- harmonic_mean: the harmonic mean.

If 'skewness' = TRUE, the following metrics will be added:
- Bowley
- Fisher-Pearson
- Kelly
- Rao
- Pearson median

If 'kurtosis' = TRUE, the following metrics will be added:
- Bowley
- Fisher-Pearson
- Kelly
- Rao
- Pearson median

Value

A tibble with the summary metrics.

Examples


x <- c(rnorm(10),NA,10)

x

summary_num(x)


vbfelix/relper documentation built on Jan. 28, 2025, 12:15 p.m.