Get and Set Optional Attributes of a 'timeSeries'

Share:

Description

Extracts or assigns optional attributes from or to a timeSeries object.

Usage

1
2
getAttributes(obj)         
setAttributes(obj) <- value

Arguments

obj

a timeSeries object whose optional attributes are to be accessed.

value

an object, the new value of the attribute, or NULL to remove the attribute.

Details

Each timeSeries object is documented. By default a time series object holds in the documentation slot a string with creation time and the user who has defined it. But this is not all. Optionally the whole creation process and history can be recorded. For this the @documentation slot may have an optional "Attributes" element. This attribute is tracked over the whole life time of the object whenever the time series is changed. Whenever you like to be informed about the optional attributes, or you like to recover them you can dot it, and evenmore, whenever you like to add information as an addiitonal attribute you can also do it.

The two functions getAttributes and setAttributes provide access to and allow to modify the optional attributes of a timeSeries object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Create an artificial timeSeries Object - 
   tS <- dummySeries()
   tS

## Get Optional Attributes -
   getAttributes(tS)
   tS@documentation
   
## Set a new Optional Attribute -
   setAttributes(tS) <- list(what="A dummy Series")
   tS
   getAttributes(tS)
   tS@documentation

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.