[R] Write lower half of distance matrix only

From: pgseye <prseye_at_gmail.com>
Date: Fri, 25 Jul 2008 04:03:46 -0700 (PDT)


I'm very new to R. I want to know if there is any way to write only the lower half of a distance matrix created in R to a csv file for example. I get the 'cannot coerce class "dist" into a data.frame' message when I try. I have used as.matrix and can write to a file this way, but as a full matrix.

The reason I only want the lower half is that I've been doing some Mantel correlations with distance matrices (of Procrustes distances) generated by other (geometric morphometric) software that are in this format. However, I'm needing to use an alternative such as R to calculate distance matrices of Fourier coefficients which the other software can't do. So far, the Mantel correlations calculated from these two matrices (with R and also another software (Mantel for Windows)) are slightly different (when they should be exactly the same) and I'm wondering whether it's because the input format is different (ie one full, one half).



View this message in context: http://www.nabble.com/Write-lower-half-of-distance-matrix-only-tp18649556p18649556.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Jul 2008 - 11:19:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 12:32:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive