An xts
object extends the S3 class zoo
from the package of the
same name.The first difference in this extension provides for a requirement
that the index values not only be unique, but also must be of class
POSIXct
or Date
, or coercible to such.
The second difference is that the object may now carry additional
attributes that may be desired in individual time-series handling.
This includes the ability to augment the objects data with
meta-data otherwise not cleanly attachable to a standard zoo object.
Examples of usage from finance may include the addition of data
for keeping track of data sources, last update times, financial
instrument descriptions or details.
The idea behind xts
is to offer the user the ability to utilize
a standard zoo object, while providing an mechanism to customise
the object's meta-data, as well as create custom methods to handle
the object in a manner required by the user.
Users may also extend the xts
class to new classes to
allow for method overloading.
Additional benefits derive from the use of as.xts
and
reclass
, which allow for lossless two-way conversion
between common R time-series classes and the xts
object
structure. See those functions for more detail.