I am trying to understand how I can make changes to the internals of a ggplot2 chart. I started reading the few ressources I could find about ggplot_built and <
You can try to include some alpha. Instead of removing the layer, it will not show up.
count(mpg, class) %>%
mutate(pct=n/sum(n)) %>%
ggplot(aes(class, pct)) +
geom_col(fill="blue", alpha=0) +
geom_line(group=1) +
geom_point(size=4)
You can of course add the alpha afterwards like
p <- ggplot_build(p)
p$data[[1]]$alpha <- 0
plot(ggplot_gtable(p))