median-HistDat-method: Calculates the median value of the observations in the...

Description Usage Arguments Details Value Examples

Description

Calculates the median value of the observations in the histogram dataset

Usage

1
2
## S4 method for signature 'HistDat'
median(x, na.rm = FALSE, ...)

Arguments

x

An instance of the class HistDat

na.rm

Provided for compatibility with stats::median(), but ignored

...

Additional arguments that will be ignored

Details

An S3 and and S4 generic is defined for this method, allowing compatibility with existing code that calls stats::median() instead of median, which is defined as an S4 generic in this package

Value

A numeric of length 1, holding the median value of the observations in the histogram dataset

Examples

1
2
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
median(hd) # returns 2

HistDat documentation built on April 6, 2021, 9:08 a.m.