minutes {quantmod} | R Documentation |
Extract the minutes or hours of a day, or days since the beginning of the year
This function is a generic, with currently a single method implemented
for objects of class zoo
.
## S3 method for class 'zoo': seconds(x,k=1,...) seconds(x,k=1,...) ## S3 method for class 'zoo': minutes(x,k=1,...) minutes(x,k=1,...) minutes3(x,...) minutes5(x,...) minutes10(x,...) minutes15(x,...) minutes30(x,...) ## S3 method for class 'zoo': hours(x,...) ## S3 method for class 'zoo': days(x,...)
x |
zoo object with index of class Date |
k |
used to identify which “bar” obs. belongs to |
... |
additional unused arguments |
Behaves exactly as weekdays, months and quarters from base with the obvious difference in that the method extracts the minutes or hours of a day, and day of the year for a given object.
minutes3
,
minutes5
,
minutes10
,
minutes15
,
minutes30
are wrappers to the appropriate minutes
time scale.
minutes
returns the minute of the day as a character [0-59]
hours
returns the hour of the day as a character [0-23]
days
returns the day of the year as a character [001-366]
The zoo object's index must be of class POSIXct or POSIXlt, or coercible to such, and have sufficient time detail.
Jeffrey A. Ryan
start.time <- as.POSIXlt("2004-12-31 00:08:30") minute.data <- zoo(rnorm(251),seq(start.time,start.time+15000,by=60)) minutes(minute.data) minutes5(minute.data) hours(minute.data) days(minute.data)