eXtensible Time Series

Provide for uniform handling of R's different time-based data classes by extending zoo, maximizing native format information preservation and allowing for user level customization and extension, while simplifying cross-class interoperability.


News

Changed in xts 0.10-1:

o 'ylim' values passed to 'addSeries' and 'addPolygon' via '...' are now captured and honored (#220).

o 'addPolygon' now checks for ylim of zeros, as 'addSeries' does (#164).

o The 'base::as.Date.numeric' method is no longer over-ridden. The exported, but not registered, method in zoo should prevent any change in behavior.

o Series added to an existing plot are now given the same index values as the main panel (#216). There still may be some weird behavior if the new data does not have observations within the timespan of the main panel data, but no observations on the same timestamps.

o Existing 'par' values are now captured and reset before returning from plotting functions (#217).

o User-defined 'col' values are now honored when 'type="h"' (#210).

o Values passed to plotting functions are now copied from the calling environment. This enables plotting arguments to be objects passed through multiple layers of function calls.

o indexFormat is now generic, consistent with indexFormat<- (#188).

o Calling as.matrix() on a zero-width xts object now behaves consistently with zoo, and no longer throws an error (#130).

o Fix weird result in merge.xts() when 'fill' argument is NULL or a zero- length vector (#261).

o Fixed bug in endpoints() due to sub-second representation error via using integer division (%/%) with non- integer arguments (#202).

o endpoints() gained sub-second accuracy on Windows (#282).

o plot.xts() no longer errors when called on an object containing a constant value. It chooses ylim values +/-20% from the series value (#156).

o plot.xts() now places y-axis labels in the same location on the plot, regardless of data periodicity (#85).

o rbind.xts() now throws an error if passed an xts object with different number of observations in the index and data (e.g., zero-width) (#98).

Changed in xts 0.10-0:

Major changes include: o A new plot.xts() that is incompatible with earlier versions of plot.xts(). o Moved development from R-Forge to GitHub. o New xts FAQ.

Other, less disruptive changes include:

o merge.xts() now throws an error if the index contains non-finite values (#174).

o Constructors xts() and .xts() now ensure order.by and index arguments do not contain non-finite values. Many xts functions, most notably merge.xts(), expect all index values to be finite. Missing index values usually indicate an error, and always occurred at the end of the index (#173, #194, #199).

o Fixed bug in endpoints() when called on sparse data that have the same month and day, but different years (#169).

o Fixed bug in [.xts did not do the same checks on logical xts objects as it does for all other data types (#163).

o Fixed bug that caused split.xts() to error if 'f' is a character vector with more than 1 element (#134).

o Fixed bug that crashed R if 'k' argument to lag.xts() was not an integer and would be NA when coerced to integer (#152).

o period.apply() now checks to ensure the object's index is unique and sorted, and sets INDEX <- sort(unique(INDEX)) if it is not. It also ensures INDEX starts with 0 and ends with NROW(x) (#171).

o All references to the 'its' package have been removed, since it is now archived on CRAN at the request of its maintainer.

o Fixed bug that crashed R when merge.xts() was called on an empty xts object and more than one non-xts object (#157).

o Fixed bug that did not set the index's tzone attribute to UTC when index<-.xts or indexClass<- were called and 'value' did not have a tzone attribute (#148).

o Fixed a bug in endpoints() that caused incorrect results if the index was less than the epoch (#144).

o Fixed a bug that caused diff.xts() on a logical xts object to return an object with a POSIXct index.

o index.xts() works even if the package containing the class for the index is not attached (it needs to be loaded, however).

o [.xts now returns NA if a one-column xts object is subsect by NA, instead of throwing an uninformative error (#97).

o Fixed bugs that would crash R when [.xts was called a certain way and 'j' contained NA values (#97, #181).

o Fixed a bug in endpoints() where 1 second would be subtracted for any date in the year 1969. The subtraction is only supposed to occur on 1969-12-31 23:59:59.9... to work around behavior in strptime().

o timeBasedSeq() now honors hour/min/sec 'BY' values (#91).

o [.xts now throws an error if 'j' is character and not one of the column names. This is consistent with [.zoo and [.matrix (#48).

o timeBasedSeq() now works correctly when resolution is "days" the sequence includes a daylight saving time change (#67).

o Explicitly set indexTZ="UTC" for all index classes that do not have a TZ (#66). indexTZ="GMT" is also allowed.

o Fixed as.xts() when called on an 'mts' object (#64).

o Moved development from R-Forge to GitHub.

o Fixed bug in to.period() that errored when name=NULL (#5937).

o Fixed bug in .index* functions that did not account for timezones (#5891).

o Fixed bug that allowed index<-.xts to produce an unsorted index (#5893).

o Fixed bug so subsetting a zero-width xts object with a zero-length 'i' vector no longer returns an object with column names (#5885).

o Updated [.xts to handle 'i' containing multiple zeros (e.g. subsetting by a "logical" column of an integer xts object).

o endpoints() now errors if k < 0.

Changed in xts 0.9-7:

o Fixed bug that caused logical operators on xts objects to drop the 'tzone' attribute (#2750).

o Fixed bug that ignored 'which.i' argument to [.xts on zero-width xts objects (#2753).

o Fixed bug where xts() does not sort 'order.by' if x is missing (#4775).

Changed in xts 0.9-6:

o Fixed bug where setting dimnames to NULL would break as.xts() (#4794).

o Added checks to period.sum/prod/min/max to ensure INDEX is in [0,nrow(x)].

o Fixed missing argument to na_locf() in the C/C++ xtsAPI (Dirk Eddelbuettel).

Changed in xts 0.9-5:

o Increased zoo dependency version to 1.7-10 for changes in C code.

o Fixed several minor issues in the C/C++ xtsAPI (Dirk Eddelbuettel).

Changed in xts 0.9-4:

o Fixed bug where the index was missing the 'tzone' attribute.

o Fixed to.period() bug when 'indexAt' is "firstof" or "lastof". (bug #2691, patch #2710, thanks to Garrett See)

o Fixed subsetting bug on zero-width xts objects that returned NA data and an NA index (#2669).

o xts' merge() method now has 'drop' and 'check.names' arguments to match the zoo merge() method.

o 'index<-' now correctly handles UTC Date objects when resetting index values. '.index<-' behaved correctly.

o xts' rollapply() method now handles the 'fill' argument.

o Added several functions to the C/C++ API:

  • make_index_unique
  • make_unique
  • endpoints
  • do_merge_xts
  • na_omit_xts
  • na_locf

o Fixed xts' rollapply() method when input has one column, but function output has more than one column.

Changed in xts 0.9-3:

o No user-visible changes.

Changed in xts 0.9-2:

o Added C/C++ xtsAPI (Dirk Eddelbuettel)

o Added tzone() and tclass() functions as aliases to indexTZ() and indexClass(), respectively. Eventually will Deprecate/Defunct the former.

Changed in xts 0.9-1:

o xts() now ignores timezone arguments when order.by is Date class, with a warning.

Changed in xts 0.8-8:

o Modified str() output to make use of proper ISO-8601 range formating

o Fixed bug in reclass() when 'tzone' of object is different than system TZ.

o Fixed bug in xts() that dropped dims when 'x' is a 1-column matrix or data.frame.

o [.xts no longer warns if 'i' is zero-length.

o to.period() now checks that 'x' is not zero-length/width.

o Fixed edge case in Ops.xts where two objects with no common index create an invalid 'xts' object with no index.

o to.monthly() and to.quarterly() now default to drop.time=TRUE.

o Internal .drop.time() now changes the index class to Date. This affects the to.period() family of functions.

o Restore Date index/tclass conversion to POSIXct with a UTC timezone via integer division instead of double-precision division.

Changed in xts 0.8-6:

o Revert Date index/tclass conversion to POSIXct with a UTC timezone to previous behavior as in 0.8-2.

Changed in xts 0.8-5:

o A Date index/tclass is now internally converted to POSIXct with a UTC timezone ensure proper conversion regardless of user TZ settings.

o tclass is now an argument to .xts()

o Fix endpoints() properly handles millisecond time stamps (and microsecond on not Windows).

o Subsetting zero-width xts objects now behaves like zoo, with NA values returned for valid row requests.

Changed in xts 0.8-2:

o Fixed bug in lag() and diff() for character coredata.

o Fixed subsetting bug that returned a contiguous chunk of data even when a non-contiguous 'i' was provided.

o Fixed bug that ignored FinCenter/TZ for timeDate index

o period.apply() now only sets colnames if the number of columns in the input and output are equal.

o Fixed periodicity() when scale = "yearly"

o Fixed [.xts when row-subsetting via a POSIXct vector, which returned an object full of NA.

o Added '...' to axis() call inside of plot.xts() to allow for 'cex.axis' and 'cex.lab' to be passed in.

o Fixed axes=FALSE issue in plot.xts().

o Dependency now on 1.7-0 or better of zoo (R-forge at present) This build now links to C code moved from xts to zoo. At present this is only for zoo_lag (used in lag and lagts)

o Added 'drop' and 'fromLast' arguments to make.index.unique().

o Added adj.time() and shift.time()

o Fixed na.locf() bug that would fill trailing NA larger than 'maxgap' observations (#1319)

o Updated indexFormat() documentation and add an example

Changed in xts 0.8-0:

o Fix print formatting (#1080)

o Fix bug related to na.locf() and zero-width objects (#1079)

o Add .RECLASS = FALSE after '...' for as.xts.() methods. This makes all as.xts.() methods one-way (i.e. not reclass-able). Objects converted to xts via try.xts() can still be converted back to their original class via relcass().

o Fix bug that caused colnames to be dropped if object is subset by time that is not in the index.

Changes in xts 0.7-5:

o try.xts and reclass now are more efficient on xts objects, no longer appending a .RECLASS attribute. This penalty (copying) is shifted to classes that are internally converted to xts.

Changes in xts 0.7-4:

o internal attributes of index are now maintaining timezone (tzone), time class (tclass) information.

o [.xts method is now using new C code. This may revert back as character-based objects are not supported. Changed for future code refactoring into zoo, as well as performance gains on integer, double and logical values. Also added in checks for NAs. drop=TRUE now works correctly in all known applications.

o (cbind)merge.xts and rbind.xts now copy index attributes to handle internal changes to index characteristics (in C code)

o indexTZ.Rd updated to provide information regarding internal changes. Also indexTZ<- is now exported to facilitate timezone changing of xts objects.

Changes in xts 0.7-1:

o subsecond ISO8601 subsetting on dates before 1970 (epoch) is disabled. This is due to a bug in the R implementation of POSIX handling of fractional seconds pre-1970. 10 microsecond granularity is still functional for all other times. Thanks to Andreas Noack Jensen for the early bug report.

o new 'tzone' arg in xts constructor and 'tz' in .parseISO8601 allows for future support of non-system TZ dependent indexing

o internal index attribute (numeric) now can have attributes set (tzone is currently the only one used in xts). These should remain during all xts operations. Still experimental.

o naCheck has been exposed at the C level for use in packages "LinkingTo: xts". See ?xtsAPI for more details.

Changes in xts 0.7-0:

o A new NEWS file.

o print.xts now passes ...

o endpoints speedup and bug fix (thanks Ismail Onur Filiz)

o na.omit bug on logical and NaN fixes (thanks Fabrizio Pollastri and Koert Kuipers)

o fromLast=FALSE for na.locf.xts. Matching to zoo. (thanks to Sandor Benczik)

o LGLSXP support in leadingNA (R fun naCheck)

o fixed logical and NA 'j' subsetting. Thanks Koert Kuipers.

o as.xts and as.timeSeries fixes for timeSeries changes

o merge and subset now support dimensionless xts (non-standard). merge segfault fixed when merging all 3 or more zero-width xts objects and only zero-width objects. Thanks to Koert Kuipers for the report.

o added which.i to [.xts to return i values found via ISO8601 subset string

o new lines.xts and plot.xts, similar to methods in zoo

o lastof now has sec to 10 microsecond precision, and subsec arg to append to secs.

o xts() further consistency in NROW/index check

o align.time error checks for positive n= values (thanks Brian Peterson)

o toPeriod updates in C, almost exported. ~600-1200x faster

o new lag_xts in C. Increased speed and index flexibility.

o endpoints 'days' bug fix

o .makeISO8601 function to create ISO8601 compliant string from xts objects

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("xts")

0.10-1 by Joshua M. Ulrich, 2 months ago


https://github.com/joshuaulrich/xts


Report a bug at https://github.com/joshuaulrich/xts/issues


Browse source code at https://github.com/cran/xts


Authors: Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, aut], Ross Bennett [ctb]


Documentation:   PDF Manual  


Task views: Econometrics, Empirical Finance, Handling and Analyzing Spatio-Temporal Data, Time Series Analysis


GPL (>= 2) license


Imports methods

Depends on zoo

Suggests timeSeries, timeDate, tseries, chron, fts, tis, RUnit

Linking to zoo


Imported by AlphaVantageClient, CityWaterBalance, DClusterm, DMwR, DMwR2, EmiStatR, GAS, Knoema, MODIStsp, PANICr, PWFSLSmoke, PoloniexR, RObsDat, SpatialEpiApp, Strategy, TSEtools, TSdist, TSstudio, TTR, TrajDataMining, carx, covmat, creditr, dygraphs, dynatopmodel, ecd, fDMA, gdpc, geoSpectral, ggpmisc, highcharter, hydroGOF, influxdbr, kehra, kofdata, lcyanalysis, ldhmm, machina, mvMonitoring, neverhpfilter, nowcasting, pdfetch, qrmdata, qrmtools, rbcb, rmgarch, rmsfuns, rnrfa, rugarch, seasonalview, shinystan, spacetime, stressr, swmmr, tawny, tawny.types, tbl2xts, tidyquant, timeseriesdb, timetk, tsensembler, tstools, vetools.

Depended on by EIAdata, FinancialInstrument, IBrokers, JFE, PerformanceAnalytics, PortfolioAnalytics, Quandl, RFinanceYJ, RcmdrPlugin.epack, RcppXts, YieldCurve, aqr, bsts, cotrend, eDMA, egcm, eventstudies, highfrequency, hydroTSM, lfstat, mvLSW, quantmod, rts.

Suggested by BETS, DepthProc, FatTailsR, OSTSC, Rblpapi, SharpeR, TSdata, TSmisc, crawl, data.table, dataseries, ggfortify, gstat, hydroPSO, manipulateWidget, nanotime, parma, sos4R, surveillance, tframePlus, timeSeries, tolBasis, trajectories, ustyc, zoo.

Enhanced by lubridate.


See at CRAN