Want to do, proposed pipeline:

library(ggplot2)
mtcars |> 
  dplyr::rename(y = mpg, x = vs) |> 
  StatCount$setup_data() |> 
  StatCount$setup_params() |> # complains
  StatCount$compute_layer() |> # complains
  StatCount$compute_panel() |> # complains
  StatCount$compute_group() 

Can do, pruned pipeline:

library(ggplot2)
mtcars |> 
  dplyr::rename(y = mpg, x = vs) |> 
  StatCount$setup_data() |> 
  # StatCount$setup_params() |> # complains
  # StatCount$compute_layer() |> # complains
  # StatCount$compute_panel() |> # complains
  StatCount$compute_group() 
##   count   prop x flipped_aes
## 1    18 0.5625 0       FALSE
## 2    14 0.4375 1       FALSE


Error ‘StatCount$setup_params()’:

mtcars |> 
  dplyr::rename(y = mpg, x = vs) |> 
  StatCount$setup_data() |> 
  StatCount$setup_params() 
## Error in has_flipped_aes(data, params, main_is_orthogonal = FALSE): argument "params" is missing, with no default

Error ‘StatCount$compute_layer()’

mtcars |> 
  dplyr::rename(y = mpg, x = vs) |> 
  StatCount$setup_data() |> 
  # StatCount$setup_params() |> # complains
  StatCount$compute_layer() 
## Error in as.vector(y): argument "params" is missing, with no default

Error ‘StatCount$compute_panel()’

mtcars |> 
  dplyr::rename(y = mpg, x = vs, group = -1L) |> 
  # StatCount$setup_data() |> 
  # StatCount$setup_params() |> # complains
  # StatCount$compute_layer() |> # complains
  StatCount$compute_panel() # complains
## Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...): group length is 0 but data length > 0

Can we fill in arguments manually to make pipeline go? And so have a look at within pipeline states? If we figure that out for one Stat, could it be applied to other Stats/Geoms and ggproto objects.