weeks {quantmod} | R Documentation |
Extract weeks. This is a generic function, methods for zoo classes are documented here
weeks(x, abbreviate) years(x, abbreviate)
x |
zoo object with index of class Date |
abbreviate |
abbreviate the results |
Behaves exactly as weekdays, months and quarters from base with the obvious difference in that the method extracts the weeks or years of the object.
A numeric vector giving the week number corresponding to each
observed date for weeks
, and year for years
.
~~further notes~~ The zoo object's index must be of class Date, or coerceable to such.
Jeffrey A. Ryan
zoo
zoo.data <- zoo(rnorm(31)+10,as.Date(13514:13744,origin="1970-01-01")) weeks(zoo.data) years(zoo.data)