Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

communities

Construct communities from individuals


Description

Construct communities from individuals using geographical distance and hierarchical clustering. Communities are clusters of geographically close individuals, formed by hclust with specified distance cutoff.

Usage

communities(geodist,grouping=NULL,
                        cutoff=1e-5,method="single")

Arguments

geodist

dist-object or matrix of geographical distances between individuals.

grouping

something that can be coerced into a factor. Different groups indicated by grouping cannot be together in the same community. (If NULL, there is no constraint.)

cutoff

numeric; clustering distance cutoff value, passed on as parameter h to cutree. Note that if this is smaller than the smallest nonzero geographical distance, communities will be all sets of individuals that have zero geographical distance to each other.

method

method-parameter for hclust.

Value

Vector of community memberships for the individuals (integer numbers from 1 to the number of communities without interruption.

Author(s)

See Also

Examples

data(veronica)
  ver.geo <- coord2dist(coordmatrix=veronica.coord[1:90,],file.format="decimal2")
  species <-c(rep(1,64),rep(2,17),rep(3,9))
  communities(ver.geo,species)

prabclus

Functions for Clustering and Testing of Presence-Absence, Abundance and Multilocus Genetic Data

v2.3-2
GPL
Authors
Christian Hennig <christian.hennig@unibo.it>, Bernhard Hausdorf <Hausdorf@zoologie.uni-hamburg.de>
Initial release
2020-01-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.