Learn R Programming

xts (version 0.14.1)

dimnames.xts: Dimnames of an xts Object

Description

Get or set dimnames of an xts object.

Usage

# S3 method for xts
dimnames(x)

# S3 method for xts dimnames(x) <- value

Value

A list or character string containing coerced row names and/or actual column names.

Attempts to set rownames on xts objects via rownames or dimnames will silently fail.

Arguments

x

An xts object.

value

A two element list. See Details.

Author

Jeffrey A. Ryan

Details

For efficienty, xts objects do not have rownames (unlike zoo objects). Attempts to set rownames on an xts object will silently set them to NULL. This is done for internal compatibility reasons, as well as to provide consistency in performance regardless of object use.

See Also

xts()

Examples

Run this code

x <- xts(1:10, Sys.Date()+1:10)
dimnames(x)
rownames(x)
rownames(x) <- 1:10
rownames(x)
str(x)

Run the code above in your browser using DataLab