Kombinierte bar-plot und Punkte in ggplot2

Ich würde gerne Grundstück eine "Kombination" bar-plot mit Punkten.
Betrachten Sie folgende dummy-Daten:

library(ggplot2)
library(gridExtra)
library(dplyr)

se <- function(x){sd(x)/sqrt(length(x))}

p1 <- ggplot(mtcars, aes(y=disp, x=cyl, fill=cyl)) 
p1 <- p1 + geom_point() + theme_classic() + ylim(c(0,500))

my_dat <- summarise(group_by(mtcars, cyl), my_mean=mean(disp),my_se=se(disp))

p2 <- ggplot(my_dat, aes(y=my_mean,x=cyl,ymin=my_mean-my_se,ymax=my_mean+my_se))
p2 <- p2 + geom_bar(stat="identity",width=0.75) +     geom_errorbar(stat="identity",width=0.75) + theme_classic() + ylim(c(0,500))

Die Letzte Handlung sollte wie folgt Aussehen:
Kombinierte bar-plot und Punkte in ggplot2

InformationsquelleAutor jokel | 2015-03-02
Schreibe einen Kommentar