Learn R Programming

zoocat (version 0.2.0.1)

index_detach: Detach index of a zoo object

Description

Detach the index of a zoo object to be seperated values of year/month/day/hour/minute/second, and return a data frame containing these columns.

Usage

index_detach(x, ...)

# S3 method for zoo index_detach(x, nfield = 2, ...)

Arguments

x

a object.

...

further arguments.

nfield

numeric. Number of fields of time to retain.

Value

a data frame.

Examples

Run this code
# NOT RUN {
x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
x <- zoo(rnorm(5), x.Date)
index_detach(x, 3)

y.POSIXct <- ISOdatetime(2003, 02, c(1, 3, 7, 9, 14), 0, 0, 0)
y <- zoo(rnorm(5), y.POSIXct)
index_detach(y, 6)

# }

Run the code above in your browser using DataLab