I have got the following data frame
species <- c("Acer pseudoplatanus", "Acer pseudoplatanus")
position <- c("o", "c")
pd <- c(-0.1, -0.2)
sd_pd <-c(0.001, 0.023)
md<- c(-0.3, -0.45)
sd_md <-c(0.024, 0.03)
df <- data.frame (species,position, pd, sd_pd, md, sd_md)
Now I would like to plot the values of pd and md for both positions (o, c) with the according error bar. On the x axis I would like to have the position, and the points for pd and md should be colored differently. Since the error bars overlap I would like to separate the points along the x axis, I tried it with ggplot and geom_point(position = position_dodge(0.5)) but that didn't work. Does someone know how to separate the points?