Entering edit mode
21 months ago
bsp017
▴
50
I would like my plot to have horizontal lines at the top and bottom of error bars. Is there a way to make sure they appear? Also the position dodge does not seem to work. The vertical error bar lines are not dodging.
library(dplyr)
library(stringr)
library(ggplot2)
ggplot(data2, aes(x=Cohort, y=Mean_R2, color = Trait)) +
geom_errorbar(aes(ymin=Mean_R2+SD, ymax=Mean_R2-SD), position=position_dodge(0.05))+
xlim(0, 10000)
Data
Trait Cohort Mean_R2 SD Trait_color
Color 10 0.02947673 0.02082434 Color
Color 50 0.2259004 0.04675703 Color
Color 100 0.3245573 0.04779442 Color
Color 500 0.4892648 0.04745342 Color
Color 1000 0.5447884 0.04178 Color
Color 5000 0.5954482 0.0355258 Color
Color 10000 0.632652 0.03706049 Color
Color 25000 0.6181629 0.03825963 Color
Color 50000 0.6079681 0.04134136 Color
Color 100000 0.5880006 0.0465956 Color
Color 1000000 0.4801181 0.05596124 Color
Health 10 0.1669139 0.03696639 Health
Health 50 0.448158 0.04392942 Health
Health 100 0.4819306 0.04525248 Health
Health 500 0.4788394 0.05993038 Health
Health 1000 0.5137877 0.05924604 Health
Health 5000 0.5665759 0.05810662 Health
Health 10000 0.5921626 0.05924604 Health
Health 25000 0.6366738 0.06368359 Health
Health 50000 0.6277492 0.0692886 Health
Health 100000 0.6023589 0.07283448 Health
Health 1000000 0.4107126 0.1088985 Health
let me know if this works.
I get the following error:
Sorry should be this. Assuming SD is already assigned a value.
SD is already assigned. The image is not correct.