[R] distance matrix

From: antu <ananta.acharya_at_gmail.com>
Date: Thu, 05 May 2011 03:34:25 -0700 (PDT)


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

Thanks       

--
View this message in context: http://r.789695.n4.nabble.com/distance-matrix-tp3498033p3498033.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 - 14:45:18 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 - 15:20: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