I have counts of salary data broken up into different neighborhoods hood and further broken down into different income brackets along with their margin of error min and max for each income bracket. I want to plot the income brackets with their margin of error per neighborhood. Below is a subset of my data:
hood PHE_Less than 20k PHE_Less than 20k max PHE_Less than 20k min PHE_20k to 35k PHE_20k to 35k max PHE_20k to 35k min
a 291 368.38 213.62 250 331.15 168.85
b 220 283.86 156.14 125 185.47 64.53
c 226 296.82 155.18 306 394.33 217.67
d 25 41.82 8.18 73 107.94 38.06
And this is my R code:
PHE_20k.to.35k <- ggplot ( data = mydata2
,aes ( x = hood
,y = PHE_20k.to.35k
,fill= hood)) +
geom_bar (stat = "identity", group = 2) +
geom_errorbar( aes (ymin = PHE_20k.to.35k.max
,ymax = PHE_20k.to.35k.min)
,width = .2) +
ylab("20k to 35k") +
xlab("") +
guides (fill = F)
PHE_20k.to.35k
This only gets me one income bracket per hood. How can I add the other one?
I want to have the 2 income brackets PHE_Less than 20k and PHE_20k to 35k with their margin of errors per hood and have a legend show which income bracket is which. In reality I have 4 income brackets per neighborhood but this will help me finish that.
Any help will be appreciated!

