season {lfstat} | R Documentation |
Attribute dates to seasons
Description
Based on a vector of breaks (start dates) dates are classified into seasons.
Usage
season(x, start = c(winter = as.Date("2005-12-01"),
spring = as.Date("2005-03-01"),
summer = as.Date("2005-06-01"),
autumn = as.Date("2005-09-01")))
Arguments
x |
Vector of dates to be classified into seasons. Methods for class |
start |
Possibly named vector of starts of a season. If the vector is unnamed generic names are used and a warning is risen. |
Value
Factor of classifications of seasons.
See Also
link{apply.seasonal}
Examples
# input vector is of class Date
times <- seq(from = Sys.Date(), to = Sys.Date() + 500, by = 20)
season(times)
# input vector is numeric (the day of the year)
n <- as.numeric(format(times, "%j"))
season(n)
identical(season(times), season(n))
[Package lfstat version 0.9.12 Index]