Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xtsAttributes

Extract and Replace xts Attributes


Description

Extract and replace non-core xts attributes.

Usage

xtsAttributes(x, user=NULL)

xtsAttributes(x) <- value

Arguments

x

an xts object

user

logical; should user-defined attributes be returned? The default of NULL returns all xts attributes.

value

a list of new name=value attributes

Details

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.

Value

A named list of user settable attributes.

Author(s)

Jeffrey A. Ryan

See Also

Examples

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)

xts

eXtensible Time Series

v0.12.1
GPL (>= 2)
Authors
Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, aut], Ross Bennett [ctb], Corwin Joy [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.