> > On Nov 5, 2011, at 7:20 PM, ScottDaniel wrote: > > > So I have a text file that looks like this: > > "Label" "X" "Y" "Slice" > > 1 "Field_1_R3D_D3D_PRJ_w617.tif" 348 506 1 > > 2 "Field_1_R3D_D3D_PRJ_w617.tif" 359 505 1 > > 3 "Field_1_R3D_D3D_PRJ_w617.tif" 356 524 1 > > 4 "Field_1_R3D_D3D_PRJ_w617.tif" 2 0 1 > > 5 "Field_1_R3D_D3D_PRJ_w617.tif" 412 872 1 > > 6 "Field_1_R3D_D3D_PRJ_w617.tif" 422 863 1 > > 7 "Field_1_R3D_D3D_PRJ_w617.tif" 429 858 1 > > 8 "Field_1_R3D_D3D_PRJ_w617.tif" 429 880 1 > > 9 "Field_1_R3D_D3D_PRJ_w617.tif" 437 865 1 > > 10 "Field_1_R3D_D3D_PRJ_w617.tif" 447 855 1 > > 11 "Field_1_R3D_D3D_PRJ_w617.tif" 450 868 1 > > 12 "Field_1_R3D_D3D_PRJ_w617.tif" 447 875 1 > > 13 "Field_1_R3D_D3D_PRJ_w617.tif" 439 885 1 > > 14 "Field_1_R3D_D3D_PRJ_w617.tif" 2 8 1 > > > > What it represents are the locations of centromeres per nucleus in a > > microscope image. What I need to do is do a dist() on each grouping > > (the > > grouping being separated by the low values of x and y's) and then > > compute an > > average. The part that I'm having trouble with is writing code that > > will > > allow R to separate these objects. > > I'm having trouble figuring out what you mean by "separating the > objects". Each row is a separate reading, and I think you just want > pairwise distances, right?
What I mean is that rows 1-3 represent one group of centromeres and rows 5-13 represent a second group. So I want to do a separate dist on each group (i.e. I want a pair wise distance for rows 1 and 3 but not 1 and 12). Does that clear thing up? -- View this message in context: http://r.789695.n4.nabble.com/Doing-dist-on-separate-objects-in-a-text-file-tp3994515p3996701.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ R-help@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.