dimnames.xts | R Documentation |
Get or set dimnames of an xts object.
## S3 method for class 'xts'
dimnames(x)
## S3 replacement method for class 'xts'
dimnames(x) <- value
x |
An xts object. |
value |
A two element list. See 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.
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.
Unlike zoo, all xts objects have dimensions. xts objects cannot be plain vectors.
Jeffrey A. Ryan
xts()
x <- xts(1:10, Sys.Date()+1:10)
dimnames(x)
rownames(x)
rownames(x) <- 1:10
rownames(x)
str(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.