Skip to content
Prev 350633 / 398502 Next

Mantel test

Assuming the 'matrix' format is a symmetrical distance 'matrix' stored as a data frame (which read.csv creates) rather a rectangular data 'matrix,' you can convert it to a dist object with as.dist(). 

?dist

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Nick Jeffery
Sent: Monday, May 4, 2015 10:49 AM
To: r-help at r-project.org
Subject: [R] Mantel test

Dear R users,

I'm having trouble getting my data into R in the correct format to run a
Mantel test.

I'm testing genome size differences by genetic distances of the 28S gene
for ~30 species. I'm able to get my genome size data (as a single column of
data) into matrix and dist formats in R but the genetic distances output by
MEGA are already in 'matrix' format so I don't know how to load this CSV
file into R without it calculating new genetic distances when I convert it
to the dist form required by the test.

Thanks in advance,
Nick