11\name {xts }
22\alias {xts }
3+ \alias {.xts }
34\alias {is.xts }
45\title { Create Or Test For An xts Time - Series Object }
56\description {
@@ -15,22 +16,44 @@ xts(x = NULL,
1516 tzone = Sys.getenv(" TZ" ),
1617 ... )
1718
19+ .xts(x = NULL ,
20+ index ,
21+ tclass = c(" POSIXct" , " POSIXt" ),
22+ tzone = Sys.getenv(" TZ" ),
23+ check = TRUE ,
24+ unique = FALSE ,
25+ ... )
26+
1827is.xts(x )
1928}
2029
2130\arguments {
2231 \item {x }{ an object containing the time series data }
23- \item {order.by }{ a corresponding vector of unique times / dates - must be
24- of a known time - based class. See details. }
25- \item {frequency }{ numeric indicating frequency of \code {order.by }. See details. }
26- \item {unique }{ should index be checked for unique time - stamps ? }
27- \item {tzone }{ time zone of series. This is ignored for Date indices }
28- \item {\dots }{ additional attributes to be added. See details. }
32+ \item {order.by }{ a corresponding vector of dates / times of a known time - based
33+ class. See Details. }
34+ \item {index }{ a corresponding \emph {numeric } vector specified as seconds
35+ since the UNIX epoch (1970 - 01 - 01 00 : 00 : 00.000 ) }
36+ \item {frequency }{ numeric indicating frequency of \code {order.by }. See Details. }
37+ \item {unique }{ check the index for unique timestamps ? }
38+ \item {check }{ check that the index is ordered ? }
39+ \item {tclass }{ time class to use for the index. See code {\link {tclass }}. }
40+ \item {tzone }{ time zone of the index (ignored indices without a time
41+ component , e.g. Date , yearmon , yearqtr ). See \code {\link {tzone }}. }
42+ \item {\dots }{ additional attributes to be added. See Details. }
2943}
3044\details {
3145An \code {xts } object extends the S3 class \code {zoo } from the package of the
3246same name.
3347
48+ The \code {xts()} constructor is the preferred way to create xts objects. It
49+ performs several checks to ensure it returns a well - formed xts object. The
50+ \code {.xts()} constructor is mainly for internal use. It is more efficient than
51+ the regular \code {xts()} constructor because it doesn ' t perform as many
52+ validity checks. Use it with caution.
53+
54+ % TODO: add notes here about the differences between ' empty ' , ' zero - width ' , and
55+ % ' zero - length ' xts objects.
56+
3457Similar to zoo objects, xts objects must have an ordered index. While zoo
3558indexes cannot contain duplicate values, xts objects have optionally supported
3659duplicate index elements since version 0.5-0. The \c ode{xts} class has one
@@ -51,7 +74,7 @@ incorrect format, non-existent time due to daylight saving time, etc). Because
5174of how non-finite numbers are represented, a missing timestamp will always be
5275at the end of the index (except if it is \c ode{-Inf}, which will be first).
5376
54- Another difference is that the object may now carry additional
77+ Another difference from \p kg{zoo} is that xts object may carry additional
5578attributes that may be desired in individual time-series handling.
5679This includes the ability to augment the objects data with
5780meta-data otherwise not cleanly attachable to a standard zoo object.
@@ -68,7 +91,7 @@ the object in a manner required by the user.
6891Many xts - specific methods have been written to better handle the
6992unique aspects of xts. These include , \sQuote {" [" }, merge , cbind ,
7093rbind , c , Ops , lag , diff , coredata , head and tail. Additionally
71- there are xts specific methods for converting amongst R' s different
94+ there are xts specific methods for converting to / from R ' s different
7295time-series classes.
7396
7497Subsetting via "[" methods offers the ability to specify dates by
@@ -86,8 +109,8 @@ Leading zeros are not necessary. See the examples for more detail.
86109Users may also extend the \c ode{xts} class to new classes to
87110allow for method overloading.
88111
89- Additional benefits derive from the use of \code {as.xts } and
90- \code {reclass }, which allow for lossless two - way conversion
112+ Additional benefits derive from the use of \c ode{\l ink{ as.xts} } and
113+ \c ode{\l ink{ reclass} }, which allow for lossless two-way conversion
91114between common R time-series classes and the \c ode{xts} object
92115structure. See those functions for more detail.
93116
@@ -108,8 +131,8 @@ automagically handle \emph{all} data objects
108131as one would handle a \c ode{zoo} object.
109132
110133}
111- \seealso { \code {\link {as.xts }}, \code {\link {reclass }},
112- \code {\link {xtsAttributes }} }
134+ \s eealso{ \c ode{\l ink{as.xts}}, \c ode{\l ink{index}}, \c ode{ \l ink{tclass }},
135+ \c ode{ \l ink{tformat}}, \c ode{ \l ink{tzone}}, \c ode{\l ink{xtsAttributes}} }
113136\e xamples{
114137data(sample_matrix)
115138sample.xts <- as.xts(sample_matrix, descr=' my new xts object ' )
0 commit comments