Learn R Programming

zoocat (version 0.2.0.1)

reset_index_var: Reset index variable of a zoocat object

Description

Reset the index variable of a "zoocat" object to be one of the fields in the cattr table.

Usage

reset_index_var(x, ...)

# S3 method for zoocat reset_index_var(x, index.var, ...)

Arguments

x

the object.

...

other arguments.

index.var

the name of the variable to be set as the index. Must be one of the cattr field.

Value

a "zoocat" object.

Examples

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

# }

Run the code above in your browser using DataLab