knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

devtools::load_all(".")

astimeseries

Travis build status AppVeyor build status Codecov test coverage

The objective of astimeseries is to simplify and assure the correct coercion among data structures used in the tidyverse to R-Mertrics (timeSeries class).

Installation

You can install the development version from GitHub with:

install.packages("devtools")
devtools::install_github("Reckziegel/astimeseries")

Example

Suppose you have the following tibble:

library(tibble)

tbl <- tibble(date = as.Date(c('2019-01-01', '2019-01-02', '2019-01-03')),
               a    = rnorm(3),
               b    = rnorm(3),
               c    = rnorm(3))

tbl

If you try to coerce the tbl object to a timeSeries (the data structure R-Metrics likes to work with), the timestamps attributes are lost:

library(timeSeries)

as.timeSeries(tbl)

Instead, it's safer to use as_timeseries to ensure all information is keeped approprietly.

# library(astimeseries)
as_timeseries(tbl)


Reckziegel/astimeseries documentation built on Nov. 13, 2019, 12:32 a.m.