[R-sig-eco] construct a nearest neighbor contingency table

Sarah Goslee sarah.goslee at gmail.com
Wed Jun 4 03:42:10 CEST 2008


What about using dist() on the xy coordinates, then finding the minimum
for each row? That would get you nearest neighbor for each site.

Sarah

On Tue, Jun 3, 2008 at 7:28 PM, Tom Elliott <tnelliott at gmail.com> wrote:
> Hello-
>
> I have plot data of  mapped male and female cottonwoods, collected for
> my master's thesis. The data are multiple rows in 3 columns:
> x-coordinate, y-coordinate, and a code for male, female, or unknown. I
> want to test it for spatial segregation of the sexes using methods by
> Phillip Dixon (1994, 2002).
>
>  Is there a way in R to build a nearest neighbor contingency table for
> the data? I would like the format to be 3 rows (male, female,
> unknown), with columns for counts of the nearest neighbors in each
> class.
>
> Thanks,
> Tom
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list