[R] distance matrix

csrabak crabak at acm.org
Thu May 5 17:09:26 CEST 2011


Em 5/5/2011 07:34, antu escreveu:
> Hello all,
>
> I am wondering if there is anyway to create distance matrix for replicated
> data
>
> for example,
>
> I have a data like
>
> sample	pop	id	var1 	var2	var3	var4
> 1.1	1	a	1	1	0	1
> 1.2	1	a	0	0	1	0
> 1.3	1	a	1	1	0	1
> 2.1	2	b	0	0	1	0
> 2.2	2	b	1	1	1	1
> 2.3	2	b	0	1	0	0
> 2.4	2	b	1	0	1	1
> 3.1	3	a	0	1	0	1
> 3.2	3	a	1	1	1	0
> 3.3	3	a	0	0	0	0
>
>
> dist(data[,c(4:7)] gives the distance of samples, but I also need the
> distances of pop ie (1,2,3) and also id (a,b) how can I achieve this??
>
Just a doubt: does the idea of comparing (ordering) the variable pop and 
id make sense? Or expressed in more direct way: what would a distance 
between b and a mean (same for the pop labels)?



More information about the R-help mailing list