Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parse_index

Developer Tools for parsing date and date-time information


Description

These functions are designed to assist developers in extending the modeltime package.

Usage

parse_index_from_data(data)

parse_period_from_index(data, period)

Arguments

data

A data frame

period

A period to calculate from the time index. Numeric values are returned as-is. "auto" guesses a numeric value from the index. A time-based phrase (e.g. "7 days") calculates the number of timestamps that typically occur within the time-based phrase.

Value

  • parse_index_from_data(): Returns a tibble containing the date or date-time column.

  • parse_period_from_index(): Returns the numeric period from a tibble containing the index.

Examples

library(dplyr)
library(timetk)

predictors <- m4_monthly %>%
    filter(id == "M750") %>%
    select(-value)

index_tbl <- parse_index_from_data(predictors)
index_tbl

period <- parse_period_from_index(index_tbl, period = "1 year")
period

modeltime

The Tidymodels Extension for Time Series Modeling

v0.5.1
MIT + file LICENSE
Authors
Matt Dancho [aut, cre], Business Science [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.