Thanks a lot in advance for any help
This is my data:
| Samples | S | Singletons | Doubletons | Chao1 | Jack1 |
|---|---|---|---|---|---|
| 1 | 43.92 | 32.04 | 8.88 | 101.8 | 44.1 |
| 2 | 63.8 | 33.08 | 17.87 | 96.43 | 84.71 |
| 3 | 76.51 | 32.78 | 18.42 | 106.6 | 102.78 |
| 4 | 86.25 | 34.27 | 17.5 | 120.16 | 117.02 |
| 5 | 94.4 | 36.13 | 16.44 | 134.01 | 128.17 |
I'm trying to change the order of legend in a graphic that represents species accumulation curve with data shown above. The code that I am using for this is this:
p2 <- ggplot(data = data, aes(x = Samples)) +
geom_point(aes(y = S.est.), shape = 22, fill = "turquoise")+
geom_point(aes(y = Singletons.Mean), shape = 17, fill = "purple")+
geom_point(aes(y = Doubletons.Mean))+
geom_point(aes(y = Chao.1.Mean), shape = 21, fill = "red")+
geom_point(aes(y = Jack.1.Mean))+
geom_line(aes(y = S.est., colour = "S (est)"), size = 1) +
geom_line(aes(y = Singletons.Mean, colour="Singletons"), size = 1) +
geom_line(aes(y = Doubletons.Mean, colour="Doubletons"), size = 1) +
geom_line(aes(y = Chao.1.Mean, colour = "Chao 1"), size = 1) +
geom_line(aes(y = Jack.1.Mean, colour = "Jack 1"), size = 1) +
labs(x = "Sampling days", y = "Number of species") +
scale_x_continuous(limits = c(1, 12), breaks = c(0, 2, 4, 6, 8, 10, 12)) +
scale_y_continuous(limits = c(0, 200), breaks = c(0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200)) +
scale_color_manual(name = "Richness estimators ",
values=c("#CC0000","#006600", "#669999", "#00CCCC",
"#660099"))+
theme_bw()
I have try on doing this with many commands as scale_color_manual, scale_fill_discrete and others but nothing works. It's just doesn't change nothing. The order I want is S, Singl, Doubl, Chao and Jack.
Also, any suggestion that can help me make this graph more aesthetic will be very well received.
Thanks a lot and good night.




