Re: [R] distance matrix

From: csrabak <crabak_at_acm.org>
Date: Thu, 05 May 2011 12:09:26 -0300

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)?



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 05 May 2011 - 15:18:22 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 Thu 05 May 2011 - 18:00:05 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