[R] triangular matrix

Miguel Manese jjonphl at gmail.com
Mon Jun 18 13:37:14 CEST 2012


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



More information about the R-help mailing list