Learn R Programming

cheddar (version 0.1-639)

CollectionCPS: Collection community properties

Description

Returns a data.frame of first-class and computed properties of communities in a CommunityCollection.

Usage

CollectionCPS(collection, properties=NULL)

Value

A data.frame.

Arguments

collection

an object of class CommunityCollection.

properties

the names of the properties to be returned.

Author

Lawrence Hudson

Details

This function is named CollectionCPS for Collection Community PropertieS.

The properties argument is a vector whose entries are either names of first-class properties or names of functions which take as single required argument a CommunityCollection and return a single value. If properties is NULL, all first-class properties are included in the returned data.frame.

See Also

CPS, CommunityPropertyNames, CommunityCollection

Examples

Run this code
data(pHWebs)

CollectionCPS(pHWebs)

# pH and a computed property
CollectionCPS(pHWebs, c('pH', 'NumberOfNodes'))

# A shorter name for the 'NumberOfNodes' column
CollectionCPS(pHWebs, c('pH', S='NumberOfNodes'))

# A function that returns more than one value. Some pHWebs communities contain 
# nodes (detritus and the like) that do not have a category. These appear in 
# .
CollectionCPS(pHWebs, 'SumBiomassByClass')

# Prefix columns with 'B'
CollectionCPS(pHWebs, c(B='SumBiomassByClass'))

# Remove biomasses of NA
CollectionCPS(pHWebs, list(B=list('SumBiomassByClass', na.rm=TRUE)))

Run the code above in your browser using DataLab