Learn R Programming

HistDat (version 0.2.0)

mean,HistDat-method: Calculates the mean value of all observations in the histogram dataset

Description

Calculates the mean value of all observations in the histogram dataset

Usage

# S4 method for HistDat
mean(x, ...)

Arguments

x

An instance of the class HistDat

...

Additional arguments that will be ignored

Value

A numeric of length 1, holding the mean of the observations in the dataset

Details

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

Examples

Run this code
# NOT RUN {
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
mean(hd) # returns 2
# }

Run the code above in your browser using DataLab