Code
library(tidyverse)
df <- ToothGrowth
df$dose <- as.character(df$dose)
p <- ggplot(data = df,mapping = aes(dose,len,fill = supp)) +
geom_bar(stat = "summary", fun = "mean",position = position_dodge(1))+
coord_cartesian(ylim = c(0, 40))
pggproto 对象https://ggplot2-book.org/internals.html
library(tidyverse)
df <- ToothGrowth
df$dose <- as.character(df$dose)
p <- ggplot(data = df,mapping = aes(dose,len,fill = supp)) +
geom_bar(stat = "summary", fun = "mean",position = position_dodge(1))+
coord_cartesian(ylim = c(0, 40))
player_data(plot = p ,i = 1) |> DT:::datatable()ggproto
prototype()
#> An object of class "classPrototypeDef"
#> Slot "object":
#> <S4 Type Object>
#>
#> Slot "slots":
#> character(0)
#>
#> Slot "dataPart":
#> [1] FALSE