Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

ThinkR-open/tidyxts

Repository files navigation

tidyxts

The goal of {tidyxts} is to allow user to use some tools from {dplyr} on xts (https://github.com/joshuaulrich/xts)

Installation

You can install tidyxts from github with:

# install.packages("devtools")
devtools::install_github("ThinkR-open/tidyxts")

Example

library(xts)
library(tidyxts)
data(sample_matrix)
sample.xts <- as.xts(sample_matrix, descr='my new xts object')
sample.xts %>% select(Open,Close) %>% head()
#>                Open    Close
#> 2007-01-02 50.03978 50.11778
#> 2007-01-03 50.23050 50.39767
#> 2007-01-04 50.42096 50.33236
#> 2007-01-05 50.37347 50.33459
#> 2007-01-06 50.24433 50.18112
#> 2007-01-07 50.13211 49.99185
sample.xts %>% select(1,3) %>% head()
#>                Open      Low
#> 2007-01-02 50.03978 49.95041
#> 2007-01-03 50.23050 50.23050
#> 2007-01-04 50.42096 50.26414
#> 2007-01-05 50.37347 50.22103
#> 2007-01-06 50.24433 50.11121
#> 2007-01-07 50.13211 49.99185
sample.xts %>% slice(c(1,3)) %>% head()
#>                Open     High      Low    Close
#> 2007-01-02 50.03978 50.11778 49.95041 50.11778
#> 2007-01-04 50.42096 50.42096 50.26414 50.33236

About

tidy manipulation on xts object

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages