AggregateCommunities
combines communities given in
aggregate
in to a single new Community
.
Nodes that appear in one or more of the communities in aggregate
are combined into a single node in the returned community.
The way in which numeric node properties are aggregated is governed by the
weight.by
parameter.
If weight.by
is NULL
or is not the name of a node property,
the arithmetic mean is computed for each numeric node property.
If weight.by
is the name of a node property, that property is used to
compute weighted means of the other numeric node properties; the
arithmetic mean of weight.by
is computed. This scheme means that
if a community contains both N and M, aggregation using
weight.by='N'
results in the arithmetic mean of N and the
N-weighted mean of M for each node.
Node properties that are characters or logicals are aggregated by joining
unique values with a `,'. Empty character strings are ignored.
Species that are not present in some communities in the collection are
assumed to have a value of 0
for all numeric node properties,
an empty string (''
) for all character node properties and
a value of NA
for all logical node properties.
The returned community contains the union of trophic links for each node.
Community properties are aggregated by computing the arithmetic mean of
numeric values and joining unique character and logical values with a `,'.
See the `Aggregating communities' section of the `Collections' vignette for
a more detailed explanation and examples of how properties are aggregated.
AggregateCommunitiesBy
aggregates by a property of the communities,
either first-class or computed. If there is more than one unique value of the
property across the contained communities, a new CommunityCollection
object is returned. If there is just one unique value, a single
Community
is returned.