Skip to content

triangular matrix

3 messages · Miguel Manese, lucinka

#
Hello,

I got this matrix of gentic distances between my samples. it is 85x85 but
only lower half (without diagonal) contains my distances. How can I make a
mean and standard deviation on these distances, please ?

Thank you!

Lucia

--
View this message in context: http://r.789695.n4.nabble.com/triangular-matrix-tp4633679.html
Sent from the R help mailing list archive at Nabble.com.
#
Hi Lucia,
On Mon, Jun 18, 2012 at 6:11 PM, lucinka <lucia.bohusova at gmail.com> wrote:
You can try something like

dist.vec <- dist.matrix[lower.tri(dist.matrix)]
mean(dist.vec)
sd(dist.vec)


Regards,

- Jon