powered by
Functions to calculate descriptve values for timo-of-day vectors. The heavy lifting is done by the circular package.
circular
# 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, ...)
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, ...)
descriptive values as would be returned for non-circular numeric vectors
vector of class tod
tod
additional args passed on to base stats or circular stats functions
often passed through to correponding functions in the circular packages. Otherwise logitcal. Defaults to FALSE.
FALSE
Dr. Andreas Leha
These functions are meant to provide the least surprising descriptive values.
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