Reputation: 21
I am trying to run a Mantel test in R on two distances (Geographic Distances and Genetic Distancse).
The data is saved in an Excel file as 2 columns; each row has the geographic distance and genetic distance between 2 populations.
I am running the following command which returns to be wrong for some reason
mantel.rtest(mydata$Dis, mydata$Fst, nrepet = 99)
the error message is as follow:
Error in mantel.rtest(mydata$Time, mydata$Fst, nrepet = 99) :
Object of class 'dist' expected
would appreciate any feedback.
Upvotes: 2
Views: 2556
Reputation: 83
You have to transform your data into dist() data. dis.dist<-dist(mydata$Dis) and fst.dist<-dist(mydata$Fst) and then run the mantel.rtest with the dist values.
Upvotes: 2