Hello folks, I am really new and just about to lear how to use r for my thesis for data visualization.
I have the following Problem:
I've got an Excel Chart with a column with three Patient Groups 1,2 and 3 --> 1 = 17x, 2= 15x, 3= 60x
I want to generate a bar chart showing the three groups with different colors.
This is the code:
Patientengruppe <- factor(Gesamt$Patientengruppe)
ggplot(Gesamt, aes(x=Patientengruppe, color = Patientengruppe, fill= Patientengruppe))+
geom_bar(fill = "steelblue")+
labs(x="Patientengruppe", y = "ANzahl der Patienten")+
ggtitle("Aufteilung der Patienten in Patientengruppen")
Now I've got the problem, that I can't change the colors of the single bars. All if them are steel blue. I figured, that there is probably a problem with the group Patientengruppe/ aes but I don't know how to extract the groups from the column to work on the bars separately and add them into one chart.