Learn R Programming

descsuppR (version 1.2)

mean.tod: Descriptive Statistics for time-of-day Vectors

Description

Functions to calculate descriptve values for timo-of-day vectors. The heavy lifting is done by the circular package.

Usage

# S3 method for tod
mean(x, ...)

sd(x, ...)

# S3 method for default sd(x, na.rm = FALSE, ...)

# S3 method for tod sd(x, na.rm = FALSE, ...)

# S3 method for tod median(x, na.rm = FALSE, ...)

# S3 method for tod min(..., na.rm = FALSE)

# S3 method for tod max(..., na.rm = FALSE)

# S3 method for tod quantile(x, ...)

Value

descriptive values as would be returned for non-circular numeric vectors

Arguments

x

vector of class tod

...

additional args passed on to base stats or circular stats functions

na.rm

often passed through to correponding functions in the circular packages. Otherwise logitcal. Defaults to FALSE.

Author

Dr. Andreas Leha

Details

These functions are meant to provide the least surprising descriptive values.

Examples

Run this code
times <- as.tod(c("21:53", NA, "22:30", "23:10", "23:58", "00:15", "01:01"))

mean(times)
mean(times, na.rm = TRUE)

Run the code above in your browser using DataLab