Learn R Programming

tsibble (version 0.2.0)

tsummarise: Aggregate over calendar periods

Description

It computes summary statistics for a tsibble over calendar periods, usually used in combination of group_by.

Usage

tsummarise(.data, ...)

tsummarise_all(.data, ..., .funs)

tsummarise_if(.data, ..., .predicate, .funs)

tsummarise_at(.data, ..., .vars, .funs)

tsummarize(.data, ...)

tsummarize_all(.data, ..., .funs)

tsummarize_if(.data, ..., .predicate, .funs)

tsummarize_at(.data, ..., .vars, .funs)

Arguments

.data

A data frame (of tbl_ts class).

...

Name-value pairs of expressions. The index variable must be present in the first name-value pair, with an index function. The remaining components work like summarise(). For the scoped variants like _all(), _at(), _if(), additional arguments for the function call in .funs will be ignored in .... The index functions that can be used, but not limited:

.funs

List of function calls generated by funs(), or a character vector of function names, or simply a function.

Bare formulas are passed to rlang::as_function() to create purrr-style lambda functions. Note that these lambda prevent hybrid evaluation from happening and it is thus more efficient to supply functions like mean() directly rather than in a lambda-formula.

.predicate

A predicate function to be applied to the columns or a logical vector. The variables for which .predicate is or returns TRUE are selected. This argument is passed to rlang::as_function() and thus supports quosure-style lambda functions and strings representing function names.

.vars

A list of columns generated by vars(), a character vector of column names, a numeric vector of column positions, or NULL.

Details

  • For a grouped tsibble, the rightmost grouping variable will be dropped after the operation.

  • The scoped variants only operate on the non-key and non-index variables.

See Also

dplyr::summarise_all