Telling R where to get data for a permanova
Hello,
I'm trying to do a PERMANOVA in R, but I don't really know anything about it. I've been given code by my supervisor (who I would ask but he's very busy with other projects). He's given notes in the code telling me what I need to do but not how to do it. I've managed to get part way through by experimenting and checking tutorials but at this point everyone seems to use a different way of coding the PERMANOVA and so I don't know how to point to specific data beyond just loading it in for this.
The specific line of code I can't get to work is:
Betadisper <- betadisper(Bray_Curtis, group = "Habitat", type = "centroid")
I know I need to tell it where to get the Habitat data from, but I'm not sure how as to my small amount of knowledge using group = "Habitat" should tell it to use the data with the name Habitat.
When I run it I get the error message Error in if (any(dist.neg > dist.pos)) { :
missing value where TRUE/FALSE needed
I've done some research and found out what the error means, but the guide I used I didn't really understand and I tried altering the code that it gave but to no avail.
Any help is really appreciated, I've been stuck on this for several days.