Learn R Programming

cheddar (version 0.1-639)

subset.CommunityCollection: A subset of a collection of communities

Description

A subset of a CommunityCollection.

Usage

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

Value

A new object of class CommunityCollection or 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.

Author

Lawrence Hudson

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.

See Also

CommunityCollection, CollectionCPS, subset

Examples

Run this code
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
if (FALSE) subset(pHWebs, X==1)

Run the code above in your browser using DataLab