Learn R Programming

xts (version 0.0-13)

indexClass: Extracting/Replacing the Class of an xts Index

Description

Generic functions to extract and replace the class of the index of an xts object.

Usage

indexClass(x)
indexClass(x) <- value

convertIndex(x,value)

Arguments

x
xts object
value
desired new class. See details

Details

It is possible to view and set the class of the time-index of a given xts object via the indexClass function.

The specified format must be a character string containing one of the following: Date, POSIXct, chron, yearmon, yearqtr or timeDate.

convertIndex returns a modified xts object, and does not alter the original.

Changing the index type may alter the behavior of xts functions expecting a different index, as well as the functionality of additional methods. Use with caution.