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:> 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 ?You can try something like dist.vec <- dist.matrix[lower.tri(dist.matrix)] mean(dist.vec) sd(dist.vec) Regards, - Jon
Hi Jon, thanks a lot, it seems to be working just perfect ;) thank you ! regards, Lucia -- View this message in context: http://r.789695.n4.nabble.com/triangular-matrix-tp4633679p4633809.html Sent from the R help mailing list archive at Nabble.com.