subset.CommunityCollection: A subset of a collection of communities

View source: R/community_collection.R

subset.CommunityCollectionR Documentation

A subset of a collection of communities

Description

A subset of a CommunityCollection.

Usage

## S3 method for class 'CommunityCollection'
subset(x, subset, properties=NULL, ...)

Arguments

x

An object of class CommunityCollection

subset

logical expression indicating communities to keep.

properties

The names of properties passed to CollectionCPS.

...

further arguments passed to other methods.

Details

CollectionCPS is used to gather properties. properties should contain the names of properties required to evaluate subset. If properties is NULL, all first-class properties are available to the subset expression. Returns a new CommunityCollection or NULL if no communities in x meet the criteria in subset.

Value

A new object of class CommunityCollection or NULL.

Author(s)

Lawrence Hudson

See Also

CommunityCollection, CollectionCPS, subset

Examples

data(pHWebs)

# Two communities have pH>7
subset(pHWebs, pH>7)

# No communities have pH>10 so this returns NULL
subset(pHWebs, pH>7)

# Get a subset based on a computed property
subset(pHWebs, S>50, properties=c(S='NumberOfNodes'))

# X is not a property so this raises an error
## Not run: subset(pHWebs, X==1)

quicklizard99/cheddar documentation built on Aug. 25, 2022, 5:01 a.m.