I apologize if this question has been asked before, but I looked through some answers, and wasn't able to find a solution that matched my issue. I am trying to add percentage inside the bar graph. The values that I am plotting are categorical (example: I am plotting Accuracy, and it is defined by "incorrect" and "correct" responses. I am trying to have a percentage of those responses per 1 condition).
I have played around with
geom="text" but failed.
So far my code is
ggplot(SinglePatient,aes(factor(Condition))+geom_bar(aes(fill = ACC), position = "dodge")
SinglePatient is a small sample from a larger data.frame. Here is an example from that data.
Patient Session Stimulus Trial Running[Trial] Block ACC Side Condition Group new.RT 7212 post blue_color.jpg 14 Center2ExpTrialList 2 incorrect L Center2Exp BrainHQ 251 7212 post brown_color.jpg 6 Center2ExpTrialList 2 correct R Center2Exp BrainHQ 253 7212 post blue_color.jpg 19 Center2ExpTrialList 2 correct L Center2Exp BrainHQ 256 7212 post brown_color.jpg 23 Center2ExpTrialList 12 correct R Center2Exp BrainHQ 261 7212 post blue_color.jpg 18 Center2ExpTrialList 2 correct L Center2Exp BrainHQ 267
Any help appreciated.