Learn R Programming

tsibble (version 0.2.0)

mutate.tbl_ts: Add new variables

Description

mutate() adds new variables; transmute() keeps the newly created variables along with index and keys;

Usage

# S3 method for tbl_ts
mutate(.data, ..., .drop = FALSE)

# S3 method for tbl_ts transmute(.data, ..., .drop = FALSE)

Arguments

.data

A tsibble.

...

Name-value pairs of expressions.

.drop

FALSE returns a tsibble object as the input. TRUE drops a tsibble and returns a tibble.

Details

These column-wise verbs from dplyr have an additional argument of .drop = FALSE for tsibble. The index variable cannot be dropped for a tsibble. If any key variable is changed, it will validate whether it's a tsibble internally. Turning .drop = TRUE converts to a tibble first and then do the operations.

  • summarise() will not collapse on the index variable.

See Also

dplyr::mutate

dplyr::transmute