A Time Series Toolbox for Official Statistics

Plot official statistics' time series conveniently: automatic legends, highlight windows, stacked bar chars with positive and negative contributions, sum-as-line option, two y-axes with automatic horizontal grids that fit both axes and other popular chart types. 'tstools' comes with a plethora of defaults to let you plot without setting an abundance of parameters first, but gives you the flexibility to tweak the defaults. In addition to charts, 'tstools' provides a super fast, 'data.table' backed time series I/O that allows the user to export / import long format, wide format and transposed wide format data to various file types.


{tstools} – a Time Series Toolbox for Official Statistics

CRANstatus R-CMD-check Lifecycle:stable

CRAN RStudio mirrordownloads

Plot official statistics’ time series conveniently: automatic legends, highlight windows, stacked bar chars with positive and negative contributions, sum-as-line option, two y-axes with automatic horizontal grids that fit both axes and other popular chart types. ‘tstools’ comes with a plethora of defaults to let you plot without setting an abundance of parameters first, but gives you the flexibility to tweak the defaults. In addition to charts, ‘tstools’ provides a super fast, ‘data.table’ backed time series I/O that allows the user to export / import long format, wide format and transposed wide format data to various file types.

-> pkgdown documentation <-

Installation

You can install the development version of tstools from GitHub with:

# install.packages("remotes")
remotes::install_github("kof-ch/tstools")

Example Use: Time Series Charts with Legends by Default

{tstools} lets you draw time series line charts that come with a legend out-of-the-box. Simply feed the tsplot() function with a list of time series.

library(tstools)
## basic example code
tsl <- list(
  AirPassengers = AirPassengers,
  JohnsonJohnson = JohnsonJohnson
)

tsplot(tsl)

and use easily use 2 y-axis. (I know some argue those double axes are fundamentally flawed, but my peers didn’t care and asked for it.)

tsplot(
  "Air Passengers" = tsl$AirPassengers,
  tsr = list("Johnson & Johnson" = tsl$JohnsonJohnson)
)

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("tstools")

0.4.4 by Stéphane Bisinger, a year ago


https://kof-ch.github.io/tstools/, https://github.com/KOF-ch/tstools


Report a bug at https://github.com/KOF-ch/tstools/issues


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


Authors: Matthias Bannert [aut] , Severin Thoeni [aut] , Stéphane Bisinger [aut, cre]


Documentation:   PDF Manual  


GPL-2 license


Imports data.table, graphics, jsonlite, stats, xts, yaml

Depends on zoo

Suggests knitr, openxlsx, reshape2, rmarkdown, testthat


See at CRAN