Get or set dimnames of an xts object.
1 2 3 4 5
an xts object
a list object of length two. See Details.
methods for the base functions
xts objects by design are intended for lightweight management
of time-indexed data.
Rownames are redundant in this design, as well as quite burdensome with respect to memory consumption and internal copying costs.
colnames in R make use of
dispatch internally, and thus require only modifications
to dimnames to enforce the
xts no rownames requirement.
To prevent accidental setting of rownames,
xts will simply set the rownames to
when invoked, regardless of attempts to set otherwise.
This is done for internal compatibility reasons, as well as to provide consistency in performance regardless of object use.
User level interaction with either dimnames or rownames will
produce a character vector of the index, formatted based
on the current specification of
occurs within the call by converting the results
index(x) to a character string, which itself
first creates the object type specified internally from the
underlying numeric time representation.
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. This is your warning.
xts objects have dimension. There are
xts objects representable as named or unnamed
Jeffrey A. Ryan
1 2 3 4 5 6
Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, as.Date.numeric NULL NULL NULL An 'xts' object on 2017-06-24/2017-07-03 containing: Data: int [1:10, 1] 1 2 3 4 5 6 7 8 9 10 - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : NULL Indexed by objects of class: [Date] TZ: UTC xts Attributes: NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.