Learn R Programming

zoocat (version 0.2.0.1)

as.zoo: Coercion objects to class zoo

Description

Coercing objects to class zoo.

Usage

# S3 method for zoocat
as.zoo(x, add.colname = TRUE, ...)

Arguments

x

an object.

add.colname

logical. If TRUE, column names will be added automatically.

...

further arguments.

Value

A zoo object.

Details

For zoomly and zoocat, the returned zoo object will be added column names automatically. Note that the result of as.zoo will be a zooreg object if the input x is inherited from zooreg.

Examples

Run this code
# NOT RUN {
x <- matrix(1 : 20, nrow = 5)
zc <- zoocat(x, order.by = 1991 : 1995, colattr = data.frame(month=c(2, 3, 5, 6)))
z <- as.zoo(zc)

# }

Run the code above in your browser using DataLab