'Error in m1 * m2 : non-numeric argument to binary operator (mantel test)

I'm trying to do Mantel test with symmetric matrices

mat1 chr [1:30] "Ind1" "Ind2" "Ind3" "Ind4" "Ind5"
mat2 chr [1:30] "Ind1" "Ind2" "Ind3" "Ind4" "Ind5"

I have 5 individuals in both matrices with symmetric frequency data, and ran like below.

mat1<-read.csv("GroupSinfantprox1.csv",sep=",", header=T, skip=0)
mat2<-read.csv("GroupSjuvenileprox1.csv",sep=",", header=T, skip=0)

mat1<-as.matrix(mat1)
mat2<-as.matrix(mat2)

mantel.test(mat1, mat2, nperm=999, graph=FALSE, alternative="two.sided")

However, I got an error message

Error in m1 * m2 : non-numeric argument to binary operator

I don't know how to deal with this error to do Mantel test.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source