make_year*()
to easily supply time components.stats::start()
and stats::end()
for the .full
argument in *_gaps()
, when *_gaps()
are used in other packages. (#269)rbind()
and cbind()
for tsibble, and suggest to use bind_rows()
and bind_cols()
instead. (#256)filter_in()
for yearweek
class with different week starts of than the default. (#261)as.ts.tbl_ts()
to better handle a tsibble of multiple key variables but single value. (#258).start
and .end
to *_gaps()
for custom starting and ending time. (#259)holiday_aus()
for Boxing Day. If falling on Sat/Sun, the holiday should be forwarded to 2 days. (#251)count()
and tally()
S3 methods for tsibble to behave like tibble input, and hence add_count()
and add_tally()
. (#232)yearmonth.character()
when inputs are all numbers without delimiter. (#264)NA
is accepted in year*()
, instead of errors before.yearmonth()
. (#250, @mitchelloharawild)yearmonth()
underlying data for character inputs. (#226)as_tsibble()
. (#229)by
is missing in year*()
. (#228)intersect()
, union()
, and setdiff()
) for year*
class. (#235, @wkdavis)full_join()
that produces an output with wrong temporal order. (#247)yearmonth()
supported more character formats. (#142)summarise_all()
, and made dplyr::across()
compatible with summarise.tbl_ts()
.grouped_ts[0L, ]
. (#194, @TylerGrantSmith)new_data()
for the yearweek
class. (#199)lubridate::Period
, since Period
can be ordered now. (#42)as.period()
and as.duration()
for interval class. (#206)yearweek()
gained a new argument week_start
to specify the day on which week starts based on ISO 8601 standard. (#205)yearquarter()
gained a new argument fiscal_start
to specify the starting month of a fiscal year. (#174)index_by()
+ summarise()
with grouped factors. (#197)select()
when removing redundant key. (#196)new_data.grouped_ts()
to inform “grouping structure is ignored”. (#193)vec_slice()
updates tsibble data attributes.This release uses the vctrs package internally in {tsibble}.
new_interval()
uses a new interface to create the interval and supports custom interval. Old tsibble objects will receive an error for “a corrupt tsibble”..full
argument in *_gaps
supports two more options, start()
and end()
, for padding NA
to either starting or ending time. (#147)n
in new_data()
and append_row()
supports negative integer, appending past observations to the data. (#186)scale_[x/y/colour/size/alpha/fill]_year*()
for custom ggplot2 scales.pivot_longer()
and pivot_wider()
supporting methods for tsibble.bind_rows()
and bind_cols()
are now possible for tsibble with dplyr v1.0.0.select()
a tsibble now keeps both index and key by default. (#155)tidyr::drop_na()
support for tsibble. (#173)as.ts.tbl_ts()
for ignoring implicit missings. (#160)units_since()
in favour of vec_cast()
.is.tsibble()
.as.tsibble()
.This is a maintenance release due to tidyselect
v1.0.0 changes.
This is a maintenance release for CRAN fixes.
This is a maintenance release due to the changes in the upstream package.
Suggests
.is.tsibble()
.has_gaps()
& count_gaps()
gained a new argument .name
for naming new columns.new_data()
/append_row()
.as.ts.tbl_ts()
for converting tsibble to ts
.POSIXlt
as index.filter()
, slice()
, and [.tbl_ts
.slide()
, are slided into the “questioning” lifecycle, in favour of the slide package. (#143)index_by()
supports lambda expression (#91).gather
in as_tsibble.mts()
in favour of pivot_longer
.yearweek()
handles characters containing keywords “W”/“Wk”/“Week”, for example yearweek("2019 W03")
.This is a patch release.
as.ts.tbl_ts()
for handling a tsibble of one row (#124).nest.tbl_ts()
for naming (#123).as_tsibble.ts()
(#128).index_by(.data, <empty>)
by default groups the index variable rather than previously ungroup()
.unnest_tsibble()
to minimise the impact from the upcoming API changes in tidyr::unnest()
.index_by()
allows for grouping index variable; and group_by()
will throw out an error for grouping index.semi_join.tbl_ts()
and anti_join.tbl_ts()
without suffix (#122).as.tsibble()
in favour of as_tsibble()
.fill_na()
in favour of fill_gaps()
.pull_interval()
in favour of interval_pull()
.regular
integrated to interval
, (2) attribute ordered
integrated to index
. A previously stored tsibble object may receive a warning “corrupt tsibble object”.library(tidyverse)
in front.id()
for creating key for the consistence of tidy selectors, and will be defunct as of v0.9.0.pull_interval()
in favour of interval_pull()
.as.tsibble()
in favour of as_tsibble()
. The warning is displayed once per session.gather = TRUE
in as_tsibble.ts()
in favour of pivot_longer = TRUE
.fill_na()
in favour of fill_gaps()
, and will be defunct in the next release.difftime
.hms
..drop
for dropping empty factor or not in as_tsibble()
and build_tsibble()
.-
operator between yearweek, yearmonth, and yearquarter returns class difftime
.key_data
to build_tsibble()
for the easy-to-reason purpose.yearquarter()
better supports strings that contains “Q”/“Qtr”/“Quarter”. (#107)as_tsibble.ts()
for monthly series starting at other months than January. (#89)guess_frequency.yearweek()
returns 52.18 for more accurate weekly representation, instead of 52.n()
now can be called in slice.tbl_ts()
. (#95)slice.tbl_ts()
.arrange.tbl_ts()
.*_join()
for not finding key or index when by
is specified. (#102)data(tourism)
and 2017 data.v0.8.0
grouped data frames, tsibble allows for empty key values and disregards the lazily stored key. All operations now recalculate the keying structure.grouped_ts
) is a subclassing of grouped_df
..size
is retired in stretch()
in favour of .step
.stretch()
gained a new .fill = NA
argument, which returns the same length as the input. To restore the previous behaviour, please use .fill = NULL
. (#88)slide_tsibble()
, tile_tsibble()
, stretch_tsibble()
provide fast and shorthand subsetting tsibble by rolling rows.slide()
gained a new .step
argument for calculating at every specified step instead of every single step.update_tsibble()
to update key and index a bit easier.rbind()
for dropping custom index class. (#78)count_gaps()
for dropping custom index class.count_gaps()
now only summarises keys with gaps instead of all the keys.guess_frequency.yearweek()
returning Inf
. (@jeffzi, #84)fill_gaps()
returns a grouped tsibble too.find_duplicates()
.fill_na()
in favour of fill_gaps()
..drop
in column-wise dplyr verbs.key_by()
(no idea why it’s there).scan_gaps()
joins the family of implicit missing values handlers.future_
. It requires the furrr package to be installed. (#66)[.tbl_ts
. (#76)time_in()
and filter_index()
.split_by()
and case_na()
.find_duplicates()
.fill_na()
..data
is a complete tsibble, fill_gaps()
gives a warning instead of an error when name-value pairs are supplied.filter_index()
works for a grouped tsibble.This release simplifies the “key” structure. The nesting and crossing definition has been removed from the “key” specification. One or more variables forming the “key”, are required to identify observational units over time, but no longer assume the relationship between these variables. The nesting and crossing structure will be dealt with visualisation and forecasting reconciliation in downstream packages.
count_gaps.tbl_ts()
returns a tibble containing gaps for each key value rather than an overall gap, which is consistent with the rest of tsibble methods. And all output column names that are not supplied by users gain a prefixed “.”.time_unit()
accepts interval
input instead of time vectors to avoid overheads, also marked as internal function.slider()
and pslider()
as new functions partial_slider()
and partial_pslider()
. Argument .partial
is removed from slider()
and pslider()
to feature a simpler interface.group
from build_tsibble()
. In order to construct a grouped tsibble, x
requires a grouped df.has_gaps()
to quickly check if there are implicit time gaps for each key in a tsibble.new_data()
to produce the future of a tsibble.filter_index()
to filter time window for a tsibble.time_in()
to check if time falls in the ranges in compact expression, with no need for time zone specification.new_tsibble()
creates a subclass of a tsibble.fill_na()
to fill_gaps()
, for more expressive function name and consistency to has_gaps()
and count_gaps()
. Soft-deprecated fill_na()
. (#71)is_duplicated()
, are_duplicated()
and duplicates()
.POSIXct
, time zone will be displayed in the header via print()
.holiday_aus()
that requires package “timeDate”.summarise.tbl_ts()
, select.tbl_ts()
& fill_na.tbl_ts()
scoping issue (#67).slice.tbl_ts()
correctly handles logical NA
.fill_na()
will only replace implicit time gaps by values and functions, and leave originally explicit NA
intact.tidyr::fill()
gained support for class “grouped_ts”, and it is re-exported again. (#73)fill_na()
, in favour of fill_gaps()
.find_duplicates()
, in favour of are_duplicated()
.case_na()
, and will be defunct in next release.split_by()
, which is under development as S3 generic in dplyr.as.tsibble()
, following as.tibble()
in tibble..drop
argument in column-wise verbs, and suggested to use as_tibble()
.select()
doesn’t select index, it will inform users and automatically select it.append_row()
for easily appending new observations to a tsibble. (#59)/
, consistent with lm
. (#64)fill_na()
for multiple replacements when using with group_by()
, introduced in v0.5.1.as_tsibble.grouped_df()
respected its existing groups and removed argument group
. (#60)select.tbl_ts()
. (#63)case_na()
& split_by()
.unnest.lst_ts
respects the ordering of “key” values. (#56)split_by()
and nest.tbl_ts()
respect the appearance ordering of input variables. (#57)group_indices.tbl_ts()
and key_indices()
return consistent formats as its generic.key
no longer accepted character.nest.tbl_ts()
.index_by()
gives more informative error when LHS is named as index.tibble
as.tibble()
.tibble()
.tile()
gained a new argument .bind = FALSE
.+
& -
) for yearweek, yearmonth, and yearquarter.new_interval()
creates an “interval” object with the specified values.fill_na()
for replacing values when group_by()
.[
.group_by()
+ summarise()
. (#47)unnest.lst_ts()
.gather.tbl_ts()
. (#54)slide()
& stretch()
use the same coercion rules as dplyr::combine()
now, if .bind = TRUE
.pillar
.tibble
.This release introduced the breaking changes to the “interval” class to make tsibble better support finer time resolution (e.g. millisecond, microsecond, and nanosecond). The “interval” format changes from upper case to short hand. To support new time index class, only index_valid()
and pull_interval()
need to be defined now.
group_by_key()
to easily group the key variables.slide()
gained a new argument .align = "right"
to align at “right”, “center”, or “left”. If window size is even for center alignment, either “center-right” or “center-left” is needed.+
& -
) for yearweek, yearmonth, and yearquarter.slide()
and stretch()
gained a new argument .bind = FALSE
.NA
or NULL
with 0
in the “interval” class to make the representation simpler.interval
class has new slots of “millisecond”, “microsecond”, “nanosecond”.time_unit()
is a function instead of S3 generic, and made index extension a bit easier.format.yearweek()
.group_by.lst_ts()
for dropping the grouping information.stretch2()
only applying .f
to one input.as_tsibble.grouped_df()
for groups. (#44).fill = NULL
for slide()
.purrr
style exactly (#35):
slide()
, tile()
, stretch()
return lists only instead of numerics before.slide2()
, pslide()
to map over multiple inputs simultaneously.slide_dbl()
, slide_int()
, slide_chr()
, slide_lgl()
.slide()
gained a new argument .partial
to support partial sliding.x
to .x
in slider()
, tiler()
, stretcher()
.pslider()
, ptiler()
, pstretcher()
support multiple inputs now, and split them in parallel.holiday_aus()
for Australian national and state-based public holiday.diff()
for year-week, year-month, and year-quarter.yearweek()
, yearmonth()
, yearquarter()
supported for character.slide2()
, pslide()
, tile2()
, ptile()
, stretch2()
, pstretch()
to slide over multiple inputs simultaneously (#33).units_since()
for index classes.is_53weeks()
for determine if the year has 53 ISO weeks.key_sum()
for extending tsibble.as_tsibble.ts()
removed the tsp
attribute from the value
column.lst_ts
(#25).tsibble()
.fill_na()
and count_gaps
when a tsibble of unknown interval.as_tsibble.tbl_ts()
& as_tsibble.grouped_ts()
now return self (#34).id()
is used in the tsibble context (e.g. as_tsibble()
, tsibble()
, build_tsibble()
) regardless of the conflicts with dplyr or plyr, to avoid frustrating message (#36).select.tbl_ts()
now preserved index.as.ts.tbl_ts()
for ignoring the value
argument when the key is empty.[.tbl_ts()
when subsetting columns by characters (#30).fill_na.tbl_ts()
dropping custom index class (#32).format.yearweek()
due to the boundary issue (#27).index
contains NA
, abort.nycflights13 >= 1.0.0
.The tsibble package has a hexagon logo now! Thanks Mitch (@mitchelloharawild).
difference()
computes lagged differences of a numeric vector. It returns a vector of the same length as the input with NA
padded. It works with mutate()
.gather()
/spread()
, nest()
/unnest()
to tbl_ts
.tsummarise()
.index2
deviates from index
(using index_by()
), the index2
will be part of grouping variables.This release (hopefully) marks the stability of a tsibble data object (tbl_ts
). A tbl_ts
contains the following components:
key
: single or multiple columns uniquely identify observational units over time. A key consisting of nested and crossed variables reflects the structure underlying the data. The programme itself takes care of the updates in the “key” when manipulating the data. The “key” differs from the grouping variables with respect to variables manipulated by users.index
: a variable represents time. This together the “key” uniquely identifies each observation in the data table.index2
: why do we need the second index? It means re-indexing to a variable, not the second index. It is identical to the index
most time, but start deviating when using index_by()
. index_by()
works similarly to group_by()
, but groups the index only. The dplyr verbs, like filter()
, mutate()
, operates on each time group of the data defined by index_by()
. You may wonder why introducing a new function rather than using group_by()
that users are most familiar with. It’s because time is indispensable to a tsibble, index_by()
provides a trace to understanding how the index changes. For this purpose, group_by()
is just too general. For example, index_by()
+ summarise()
aggregates data to less granular time period, leading to the update in index, which is nicely and intuitively handled now.interval
: an interval
class to save a list of time intervals. It computes the greatest common factor from the time difference of the index
column, which should give a sensible interval for the almost all the cases, compared to minimal time distance. It also depends on the time representation. For example, if the data is monthly, the index is suggested to use a yearmonth()
format instead of Date
, as Date
only gives the number of days not the number of months.regular
: since a tsibble factors in the implicit missing cases, whether the data is regular or not cannot be determined. This relies on the user’s specification.ordered
: time-wise and rolling window functions assume data of temporal ordering. A tsibble will be sorted by its time index. If a key is explicitly declared, the key will be sorted first and followed by arranging time in ascending order. If it’s not in time order, it broadcasts a warning.tsummarise()
and its scoped variants. It can be replaced by the combo index_by()
+ summarise()
(#20). tsummarise()
provides an unintuitive interface where the first argument keeps the same size of the index, but the remaining arguments reduces rows to a single one. Analogously, it does group_by()
and then summarise()
. The proposed index_by()
solves the issue of index update.inform_duplicates()
(defunct) to find_duplicates()
to better reflect its functionality.key_vars()
and group_vars()
return a vector of characters instead of a list.distinct.tbl_ts()
now returns a tibble instead of an error.dplyr::do()
and tidyr::fill()
, as they respect the input structure.index_sum()
, and replaced by index_valid()
to extend index type support.index_by()
groups time index, as the counterpart of group_by()
in temporal context.count_gaps()
and gaps()
counts time gaps (implicit missing observations in time).yearweek()
creates and coerces to a year-week object. (#17)fill_na.tbl_ts()
gained a new argument of .full = FALSE
. .full = FALSE
(the default) inserts NA
for each key within its time period, TRUE
for the entire time span. This affects the results of fill_na.tbl_ts()
as it only took TRUE
into account previously. (#15)drop
argument to .drop
in column-wise dplyr verbs.duplicated
argument in pull_interval()
.group_by.tbl_ts()
behaves exactly the same as group_by.tbl_df
now. Grouping variables are temporary for data manipulation. Nested or crossed variables are not the type that group_by()
thinks.glimpse.tbl_ts()
.fill_na()
.transmute.tbl_ts()
for a univariate time series due to unregistered tidyselect helpers. (#9).select.tbl_ts()
and rename.tbl_ts()
for not preserving grouped variables (#12).select.tbl_ts()
and rename.tbl_ts()
for renaming grouped variables.tbl_ts
gains a new attribute index2
, which is a candidate of new index (symbol) used by index_by()
.attr(grouped_ts, "vars")
stores characters instead of names, same as attr(grouped_df, "vars")
.This release introduces major changes into the underlying tbl_ts
object:
tbl_ts
class to reduce the object size, and computed on the fly when printing.arrange()
and slice()
functions.tbl_ts
object is a symbol now instead of a quosure.tbl_ts
object is an unnamed list of symbols.key_update()
to change/update the keys for a given tsibble.unkey()
as an S3 method for a tsibble of key size < 2.key_indices()
as an S3 method to extract key indices.split_by()
to split a tsibble into a list of data by unquoted variables.build_tsibble()
allows users to gain more control over a tsibble construction.as_tsibble.msts()
for multiple seasonality time series defined in the forecast package.as_tsibble.ts()
for daily time series (when frequency = 7).group_by.tbl_ts()
does not accept named expressions.filter()
and slice()
). This avoids unnecessary re-computation for many function calls.tsummarise()
including tsummarise_all()
, tsummarise_if()
, tsummarise_at()
.slide()
, tile()
, stretch()
, are no longer defined as S3 methods. Several new variants have been introduced for the purpose of type stability, like slide_lst()
(a list), slide_dfr()
(a row-binding data frame), slide_dfc()
(a column-binding data frame).index
variable must sit in the first name-value pair in tsummarise()
instead of any position in the call.transmute.tbl_ts()
keeps the newly created variables along with index and keys, instead of throwing an error before.glimpse.tbl_ts()
format.key()
for nesting crossed with another nesting.This release marks the complete support of dplyr key verbs.
tidyr::fill()
fills NA
backward or forward in tsibble.tbl_ts
support for dplyr::*_join()
.tbl_ts
support for dplyr::transmute()
and dplyr::distinct()
and return an error.inform_duplicates()
informs which row has duplicated elements of key and index variables.summarise.tbl_ts()
and tsummarise.tbl_ts()
, when calling functions with no parameters like dplyr::n()
.summarise.tbl_ts()
and tsummarise.tbl_ts()
, one grouping level should be dropped for the consistency with dplyr::summarise()
for a grouped tbl_ts
.NULL
and tbl_ts
are supported in as_tsibble()
. An empty tsibble is not allowed.group_by.tbl_ts(.data, ..., add = TRUE)
works as expected now.grouped_ts
and grouped_df
.NEWS.md
file to track changes to the package.