Learn R Programming

tsibble (version 0.2.0)

group_by.tbl_ts: Group by one or more variables

Description

Group by one or more variables

Usage

# S3 method for tbl_ts
group_by(.data, ..., add = FALSE)

# S3 method for grouped_ts ungroup(x, ...)

Arguments

.data

A tsibble.

...

Variables to group by. All tbls accept variable names. Some tbls will accept functions of variables. Duplicated groups will be silently dropped.

add

When add = FALSE, the default, group_by() will override existing groups. To add to the existing groups, use add = TRUE.

x

A (grouped) tsibble.

See Also

dplyr::group_by

dplyr::ungroup

Examples

Run this code
# NOT RUN {
data(tourism)
tourism %>%
  group_by(Region, State) %>%
  summarise(geo_trips = sum(Trips))
# }

Run the code above in your browser using DataLab