quartiles: summaryFunction for quartiles

Description Usage Arguments Details Value See Also Examples

View source: R/quartiles.R

Description

A summaryFunction, intended to be called from summarize, which calculates the 1st and 3rd quartiles of a variable. NA, NaN and Inf values are removed prior to the computations.

Usage

1
quartiles(v, maxDecimals = 2)

Arguments

v

A variable (vector) of type numeric or integer.

maxDecimals

A positive integer or Inf. Number of decimals used when printing numerical values in the data summary and in problematic values from the data checks. If Inf, no rounding is performed.

Details

The quartiles are computed using the quantile function from stats, using type 7 quantiles for integer and numeric variables and type 1 quantiles for Date variables.

Value

An object of class summaryResult with the following entries: $feature ("1st and 3rd quartiles"), $result (the 1st and 3rd quartiles of v) and $value (the quartiles in their original format).

See Also

summaryFunction, summarize, summaryResult, allSummaryFunctions

Examples

1
2
3
quartiles(c(1:100))

quartiles(rnorm(1000), maxDecimals = 4)

dataMaid documentation built on Oct. 8, 2021, 9:08 a.m.