How do I add a geom layer with a stat as a ggproto Geom subclass?

Hi ggplot2 experts,

The help for the geom_point function says the following in the help:

I know how to make a plot with stat = "identity" or stat = "summary". But I don't understand what it wants relating to a ggproto Geom subclass??

Here some example code. Can someone update so that the stat uses a ggproto Geom subclass??

library(tidyverse)
library(palmerpenguins)  
penguins |>
  ggplot() +
  geom_point(aes(x = flipper_length_mm,  y = body_mass_g), 
        stat = "identity")
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2023-12-03 with reprex v2.0.2

reprex::reprex({
library(tidyverse)
library(palmerpenguins)

penguins |>
ggplot() +
geom_point(aes(x = sex, y = body_mass_g),
stat = StatSummary)
})

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.