From this file:
https://drive.google.com/open?id=1jmZG-nyt707AhHZSSl4dHLIxK0nZ5qyX
and these packages
library(vegan)
library(reshape2)
And taking this code to make this graph, I would like to know how I can change the colors of each point to these colors "light blue" in the Oak group, "mediumorchid" in the wasteland group, "green" in the Edge group and "orange" in the Crop group
raw.data <- read.csv("Raw_Data_MJM.csv", header = TRUE)
raw.site.spp.dca <- acast(raw.data, collection + habitat ~ taxon, fill = 0)
raw.site.hab <- sapply(strsplit(rownames(raw.site.spp.dca), "_"), "[[", 2); head(raw.site.hab)
site.des <- c("C1F", "C2F", "C3F", "C4F", "Wl1F", "Wl1F2", "Wl1P", "Wl1P2", "Wl2F", "Wl2F2", "Wl2P", "Wl2P2", "Wl3F", "Wl3F2", "Wl3P", "Wl3P2", "Wl4F", "Wl4F2", "Wl4P", "Wl4P2", "H1P", "H2P", "H3P", "H4P2", "H5P2", "H6P2","Ed1F", "Ed1F2", "Ed1P", "Ed1P2", "Ed1V", "Ed1V2", "Ed2F", "Ed2F2", "Ed2P", "Ed2V", "Ed2V2", "Ed3F", "Ed3F2","Ed3P", "Ed3P2", "Ed3V", "Ed3V2", "Ed4F", "Ed4F2", "Ed4P", "Ed4P2", "Ed4V2", "M11V", "M12V", "M1V", "M2V", "M3V", "M4V", "M5V", "M7V", "M8V", "M9V", "Oa1F", "Oa1F2", "Oa1P", "Oa1P2", "Oa2F", "Oa2F2", "Oa2P", "Oa2P2", "Oa3F", "Oa3F2", "Oa3P", "Oa3P2", "Oa4F", "Oa4F2", "Oa4P", "Oa4P2", "Z1V", "Z2V", "Z3V", "Z4V")
length(site.des)
plot(raw.dca,
type = "n",
cex.main = 0.75,
cex.lab = 1.25,
axes = TRUE,
cex.axis = 1.0,
yaxt = "n",
xlim = c(-6, 6),
ylim = c(-4, 4),
#main = "Raw data",
xlab = "DCA1 (0.353 total variance)",
ylab = "DCA2 (0.243 total variance)")
axis(2, at=c(-4, -2, 0, 2, 4), tick = TRUE, cex.axis = 0.75)
points(raw.dca, col = as.integer(as.factor(raw.site.hab)),
pch = as.integer(as.factor(raw.site.hab)))
Thank you very much in advance.