Learn R Programming

zoocat (version 0.2.0.1)

as.zoocat: Coercing objects to Class zoocat

Description

Coercing objects to class zoocat.

Usage

as.zoocat(x, ...)

# S3 method for zoomly as.zoocat(x, ...)

# S3 method for zoo as.zoocat(x, colattr = NULL, variable.name = "variable", index.name = "index", ...)

Arguments

x

the object.

...

other arguments passed to methods.

colattr

a data frame the column attribute table for x.

variable.name

the name of the field in the cattr of the output zoocat object to store the variable name.

index.name

the name of the index variable.

Value

a "zoocat" object.

Examples

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

zobj <- zoo(matrix(1:10, nrow = 5), order.by = 11:15)
colnames(zobj) <- c('a', 'b')
as.zoocat(zobj)

# }

Run the code above in your browser using DataLab