So I'm trying to create a grouped bar chart from the data, where I want zipcode group on the x-axis, counts on the y-axis, with groups of visit type for each . I was to make a grouped bar chart of the two visit types. The picture is what happens with my code
Also I'm new to R so I would appreciate all the help! For some reason, the normal grouped bar chart code is not working on my dataset, so I was hoping to get some help.
ggplot()+
geom_bar(data=hospital_visits, aes(y=Counts, x= "zipcode groups", fill="visit type"), stat="identity", position='dodge')
What I want it to be
| Visit Type | Zipcode Group | Counts |
|---|---|---|
| Hospital | A | 8090 |
| Clinic | A | 10906 |
| Hospital | B | 22129 |
| Clinic | B | 27871 |