enter link description hereDummy Data Sheet
I'm having issues with getting my graphs to display error bars, even though I've copied and modified code that has worked just fine. This is the code and graph that is working:
graph2 <- summary %>%
filter(Accuracy == "FALSE") %>%
ggplot(.) + aes(x = Author, y = mean_err, fill = reorder(Quality, -mean_err)) +
geom_bar(stat = "summary", fun.y = "mean", position = "dodge") +
xlab("Race of Author") + ylab("Proportion Lure Reported") + labs(fill = "Text Quality") +
theme(panel.grid.major = element_blank(), panel.grid.minor =
element_blank(),panel.background = element_blank(), axis.line = element_line(colour =
"black")) +
geom_errorbar(aes(ymin= mean_err - se_error, ymax= mean_err + se_error),
position=position_dodge(width=0.9), width=.1) +
geom_text(aes(label=round(mean_err,digits=2)), position=position_dodge(width=.9),
vjust=5) + scale_fill_manual(values=wes_palette("GrandBudapest2"))```
This prints out a working graph with error bars.
When I tried to modify the code to have it instead show the proportion of unsure answers reported, I used this code:
filter(Accuracy == "TRUE") %>%
ggplot(.) + aes(x = Author, y = mean_unsu, fill= Author) +
geom_bar(stat = "summary", fun.y = mean, position = "dodge") +
xlab("Race of Author") + ylab("Proportion Unsure Reported") +
theme(panel.grid.major = element_blank(), panel.grid.minor =
element_blank(),panel.background = element_blank(), axis.line = element_line(colour =
"black")) +
geom_errorbar(aes(ymin= mean_unsu - se_unsu, ymax= mean_unsu + se_unsu),
position=position_dodge(width=0.9), width=.1) +
geom_text(aes(label=round(mean_err,digits=2)), position=position_dodge(width=.9),
vjust=5) + scale_fill_manual(values=wes_palette("GrandBudapest2"))
I get this image with no error bars.
I'm very confused at what I'm doing wrong. I feel like it is probably something very simple.