Description Usage Arguments Details Value Author(s) See Also Examples
Extract and replace non-core xts attributes.
| 1 2 3 | xtsAttributes(x, user=NULL)
xtsAttributes(x) <- value
 | 
| x | an xts object | 
| user |  logical; should user-defined attributes be returned?
The default of  | 
| value | a list of new name=value attributes | 
Since xts objects are S3 objects with special
attributes, a method is necessary to properly assign
and view the user-added attributes.
A call to attributes from the base package
will return all attributes, including those specific
to the xts class.
A named list of user settable attributes.
Jeffrey A. Ryan
| 1 2 3 4 5 6 7 8 9 10 | x <- xts(matrix(1:(9*6),nc=6),
         order.by=as.Date(13000,origin="1970-01-01")+1:9,
         a1='my attribute')
xtsAttributes(x)
xtsAttributes(x) <- list(a2=2020)
xtsAttributes(x)
xtsAttributes(x) <- list(a1=NULL)
xtsAttributes(x)
 | 
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
    as.Date, as.Date.numeric
$a1
[1] "my attribute"
$a1
[1] "my attribute"
$a2
[1] 2020
$a2
[1] 2020
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.