Skip to contents

Overview

Describes the key components underlying a tsibble, or tbl_ts: index, key, interval.

tsibble-package
tsibble: tidy temporal data frames and tools

Create/coerce and append to a tsibble

tsibble() creates a tbl_ts; as_tsibble() coerces other objects to tbl_ts.

tsibble()
Create a tsibble object
as_tsibble()
Coerce to a tsibble object
is_tsibble() is_grouped_ts()
If the object is a tsibble
update_tsibble()
Update key and index for a tsibble
new_data() append_row()
New tsibble data and append new observations to a tsibble
is_duplicated() are_duplicated() duplicates()
Test duplicated observations determined by key and index variables

Tsibble verbs

Verbs that manipulate data in time-based context. Inspect implicit time gaps with has_gaps(), scan_gaps(), count_gaps() and fill_gaps(). filter_index() is a shorthand for filtering time index. index_by() and group_by_key() create a grouped tsibble, or grouped_ts, but how the data looks remains unchanged. Both requires to work with other tidyverse verbs.

has_gaps()
Does a tsibble have implicit gaps in time?
scan_gaps()
Scan a tsibble for implicit missing observations
count_gaps()
Count implicit gaps
fill_gaps()
Turn implicit missing values into explicit missing values
index_by()
Group by time index and collapse with summarise()
group_by_key()
Group by key variables
filter_index()
A shorthand for filtering time index for a tsibble

Tidyverse methods

Dplyr and tidyr verbs that support manipulating and reshaping tbl_ts in time-based context.

tsibble-tidyverse
Tidyverse methods for tsibble

Vector operations

difference()
Lagged differences

Index classes

New S3 classes to represent year-week, year-month, and year-quarter.

yearmonth() make_yearmonth() is_yearmonth()
Represent year-month
yearquarter() make_yearquarter() is_yearquarter() fiscal_year()
Represent year-quarter
yearweek() make_yearweek() is_yearweek() is_53weeks()
Represent year-week based on the ISO 8601 standard (with flexible start day)
time_in()
If time falls in the ranges using compact expressions
guess_frequency()
Guess a time frequency from other index objects
scale_x_yearquarter() scale_y_yearquarter() scale_x_yearmonth() scale_y_yearmonth() scale_x_yearweek() scale_y_yearweek()
tsibble scales for ggplot2

Calendar

holiday_aus()
Australian national and state-based public holiday

Metadata

key() key_vars()
Return key variables
key_data() key_rows() key_size() n_keys()
Key metadata
index() index_var() index2() index2_var()
Return index variable from a tsibble
measures() measured_vars()
Return measured variables
interval() is_regular() is_ordered()
Meta-information of a tsibble

Extend tsibble

Add tsibble support for custom index classes with index_valid() & interval_pull(). build_tsibble() provides low-level construction for tsibble. Create a subclass of the tsibble with new_tsibble().

index_valid()
Add custom index support for a tsibble
interval_pull()
Pull time interval from a vector
new_interval() is_regular_interval() gcd_interval()
Interval constructor for a tsibble
new_tsibble()
Create a subclass of a tsibble
build_tsibble()
Low-level constructor for a tsibble object

Coerce to other objects

as.ts(<tbl_ts>)
Coerce a tsibble to a time series
as_tibble(<tbl_ts>)
Coerce to a tibble or data frame

Data

pedestrian
Pedestrian counts in the city of Melbourne
tourism
Australian domestic overnight trips