Un-grouping a data set logically combines the different arms. In the history this joins any stratified branches and acts as a specific type of status(), allowing you to generate some summary statistics about the un-grouped data. See dplyr::ungroup().

# S3 method for trackr_df
ungroup(
  x,
  ...,
  .messages = .defaultMessage(),
  .headline = .defaultHeadline(),
  .tag = NULL
)

Arguments

x

A tbl()

...

In group_by(), variables or computations to group by. Computations are always done on the ungrouped data frame. To perform computations on the grouped data, you need to use a separate mutate() step before the group_by(). Computations are not allowed in nest_by(). In ungroup(), variables to remove from the grouping.

.messages

a set of glue specs. The glue code can use any any global variable, or {.count}. the default is "total {.count} items"

.headline

a headline glue spec. The glue code can use {.count} and {.strata}.

.tag

if you want the summary data from this step in the future then give it a name with .tag.

Value

the .data dataframe but ungrouped with the history graph updated showing the ungroup operation as a new stage.

See also

dplyr::ungroup()

Examples

library(dplyr)
library(dtrackr)

tmp = iris %>% group_by(Species) %>% comment("A test")
tmp %>% ungroup(.messages="{.count} items in combined") %>% history()
#> dtrackr history:
#> number of flowchart steps: 2 (approx)
#> tags defined: <none>
#> items excluded so far: <not capturing exclusions>
#> last entry / entries:
#> └ "150 items in combined"