Skip to contents

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().

Usage

p_ungroup(
  x,
  ...,
  .messages = .defaultMessage(),
  .headline = .defaultHeadline(),
  .tag = NULL
)

Arguments

x

A tbl()

...

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"