View source: R/community_collection.R
| subset.CommunityCollection | R Documentation |
A subset of a CommunityCollection.
## S3 method for class 'CommunityCollection'
subset(x, subset, properties=NULL, ...)
x |
An object of class |
subset |
logical expression indicating communities to keep. |
properties |
The names of properties passed to |
... |
further arguments passed to other methods. |
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.
A new object of class CommunityCollection or NULL.
Lawrence Hudson
CommunityCollection, CollectionCPS,
subset
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.