Learn R Programming

zoocat (version 0.2.0.1)

cattr: Getting or setting the column attributes table of a zoocat object.

Description

Getting or setting the column attributes table of a "zoocat" object. Using cattr(x) <- value can translate a "zoo" object to a "zoocat" object.

Usage

cattr(x) <- value

# S3 method for zoocat cattr(x) <- value

# S3 method for zoo cattr(x) <- value

cattr(x)

# S3 method for zoocat cattr(x)

Arguments

x

A zoocat or zoo object.

value

The new value.

Value

"cattr(x)" return a data frame.

Examples

Run this code
# NOT RUN {
x <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = 'x')
zc <- zoocat(x, order.by = 1991 : 1995, colattr = colAttr)
cattr(zc)[, 2] <- 'y'

zobj <- zoo(x, order.by = 1991 : 1995)
cattr(zobj) <- colAttr

# }

Run the code above in your browser using DataLab