I have a dataframe (df) as follows
id | count | result |
---|---|---|
a | 3 | positive |
b | 4 | negative |
I have been able to create a bar graph with this
ggplot(df, aes(x=result, y=count, fill = id)) +
geom_bar(stat = "identity") +
labs(x = "Example", y = "Frequency", fill = "Group") +
scale_x_discrete(labels = c("Positive", "Negative"))
The resulting bar graph looks like this
However, I want the Positive to be on the left and i want group a to be blue. How would the modified code look like if i had multiple results (e.g., positive, negative, unknown, small)?