user2356142
user2356142

Reputation: 21

Mantel Test in R

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

Answers (1)

Miri Putzig
Miri Putzig

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

Related Questions