so I am very new to R and I'm trying to plot a species accumulation curve for fish species collected from 3 separate habitats. Ideally, I would like to have one plot that shows 4 curves (one for all the fish in all habitats, and 3 for the fish in each habitat).
I have been struggling to find the correct code and I came across this question asked before . I tried to copy the code to work for my data, but can't seem to figure out what small bits I need to change to make it work.
What I have so far to create the curve for all collected fish is this:
AllFish = read.csv(file.choose(), header = TRUE)
AllFish_community = AllFish[2:74]
library(vegan)
Curve = specaccum(AllFish_community, method = "random",
permutations = 100)
plot(Curve, ci = 0, ci.type = c("line"),
ylab="Number of Species")
axis(1, at=1:15)
Which gives me a nice plot like this
I would like to know how I can code it, so that I get the 3 separate habitats added to the plot. I have my data arranged like this so that the first row is the label. There are 73 species of fish in the matrix, and 5 replicates of each of the 3 habitats.
Thank you.
Edit- Here is a link to my .csv data set