[R-SIG-Finance] xts 0.13.0 released to CRAN

Joshua Ulrich jo@h@m@u|r|ch @end|ng |rom gm@||@com
Thu Feb 23 17:13:10 CET 2023


Hi all,

A new version of xts just reached CRAN. It includes several cool features:

* open-ended time-of-day subsets
    x["/T1800"])  # between the start of the day and 5pm

* to.period() supports custom endpoints
    data(sample_matrix)
    x <- as.xts(sample_matrix)
    wednesdays <- which(.indexwday(x) == 3)
    week_wed <- to.period(x, wednesdays)

* print() truncates rows (like data.table)
    print(x)
    ##                Open     High      Low    Close
    ## 2007-01-02 50.03978 50.11778 49.95041 50.11778
    ## 2007-01-03 50.23050 50.42188 50.23050 50.39767
    ## 2007-01-04 50.42096 50.42096 50.26414 50.33236
    ## 2007-01-05 50.37347 50.37347 50.22103 50.33459
    ##        ...
    ## 2007-06-26 47.44300 47.61611 47.44300 47.61611
    ## 2007-06-27 47.62323 47.71673 47.60015 47.62769
    ## 2007-06-28 47.67604 47.70460 47.57241 47.60716
    ## 2007-06-29 47.63629 47.77563 47.61733 47.66471
    ## 2007-06-30 47.67468 47.94127 47.67468 47.76719

* str() output is more informative, and less verbose
    str(x)
    ## An xts object on 2007-01-02 / 2007-06-30 containing:
    ##  Data:    double [180, 4]
    ##  Columns: Open, High, Low, Close
    ##  Index:   POSIXct,POSIXt [180] (TZ: "")

See the blog post for more examples, and to sign up for email updates
https://blog.fosstrading.com/2023/02/xts-0-13-0-on-cran.html

Best,
Josh

-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com



More information about the R-SIG-Finance mailing list