I have the following data:
> Dummydata
Sample r.K
1 E1 0.084150
2 E2 0.015170
3 E3 0.010662
4 E4 0.016123
5 EK1 0.010289
6 EK2 0.017484
7 EK3 0.014685
8 EK4 0.014272
9 EK5 0.012551
10 K1 0.010069
11 K2 0.010253
12 K3 0.010568
13 K4 0.011230
14 K5 0.010286
I made a geom_col plot with my data:
plot_dummy_data <- Dummydata %>% ggplot(aes(x = Sample, y =r.K)) +
geom_col(fill = "#FAE0B1") + labs(y= "fitness cost", x = "sample")
I want to color the first 4 columns the same color as they correspond to a specific host and the next 5 columns another color and then the last 5 columns a third color.
I have seen the function scale_fill_manual() but I don't understand how I can choose a specific color for a group of columns but not all of them.
I've been trying all day and gone through everything I could find on here but I still haven't figured it out. I'm a beginner at R so I really appreciate any help.