powered by
Group by one or more variables
# S3 method for tbl_ts group_by(.data, ..., add = FALSE)# S3 method for grouped_ts ungroup(x, ...)
# S3 method for grouped_ts ungroup(x, ...)
A tsibble.
Variables to group by. All tbls accept variable names. Some tbls will accept functions of variables. Duplicated groups will be silently dropped.
When add = FALSE, the default, group_by() will override existing groups. To add to the existing groups, use add = TRUE.
add = FALSE
group_by()
add = TRUE
A (grouped) tsibble.
dplyr::group_by
dplyr::ungroup
# NOT RUN { data(tourism) tourism %>% group_by(Region, State) %>% summarise(geo_trips = sum(Trips)) # }
Run the code above in your browser using DataLab