Learn R Programming

quantmod (version 0.2-5)

weekdays.zoo: Extract Parts of a zoo Object

Description

Extract the weekday, month or quarter. This documents the methods for the zoo class.

Usage

## S3 method for class 'zoo':
weekdays(x,abbreviate=FALSE)

## S3 method for class 'zoo': months(x,abbreviate=FALSE)

## S3 method for class 'zoo': quarters(x,abbreviate=FALSE)

Arguments

x
a zoo object with index of class Date
abbreviate
logical. Should names be abbreviated?

Value

  • weekdays and months return a character vector of the names.

    quarters returns a character vector of Q1 to Q4

See Also

DateTimeClasses, quarters, weekdays, months

Examples

Run this code
zoo.data <- zoo(rnorm(31)+10,as.Date(13514:13744,origin="1970-01-01"))
weekdays(zoo.data)
months(zoo.data)
quarters(zoo.data)

Run the code above in your browser using DataLab