NvMLinearRegressions: NvMLinearRegressions

Description Usage Arguments Value Author(s) See Also Examples

View source: R/community_MN.R

Description

Creation and analysis of linear regressions fitted to log10- transformed numerical abundance versus log10-transformed body mass.

Usage

1
2
3
4
5
6
7
8
9

Arguments

community

an object of class Community.

class

the property over which linear regressions are fitted. Defaults to 'category' if the community has a node property with that name.

Value

NvMLinearRegressions returns a list of lm objects, one for each class and one fitted to all data. The list will contain NULL if it is not possible to fit a linear regression to that class; this will happen for classes that contain just a single node or that contain all or all but one nodes where X and/or Y is NA.

NvMSlope, NvMIntercept and NvMSlopeAndIntercept return the slope, intercept and both, respectively, of a single linear regression fitted to all data. NvMSlopeByClass, NvMInterceptByClass and NvMSlopeAndInterceptByClass return the slope, intercept and both, respectively, of linear regressions fitteed to each class and one to all data. For classes where it is not possible to fit a linear regression (for the reasons given above), NvMSlopeByClass, NvMInterceptByClass and NvMSlopeAndInterceptByClass will return NA.

Author(s)

Lawrence Hudson

See Also

Community, CommunityCollection ApplyByClass

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(TL84)

models <- NvMLinearRegressions(TL84)

# 'all', 'producer', 'invertebrate', 'vert.ecto'
names(models)

# Extract slopes and intercepts
sapply(models, coef)


# Slopes and intercepts through all data for each web in the pHWebs 
# collection
data(pHWebs)
CollectionCPS(pHWebs, properties=c('NvMSlope'))
CollectionCPS(pHWebs, properties=c('NvMIntercept'))
CollectionCPS(pHWebs, properties=c('NvMSlopeAndIntercept'))

# Slopes and intercepts through each category for each web in pHWebs
CollectionCPS(pHWebs, properties=c('NvMSlopeAndInterceptByClass'))

quicklizard99/cheddar documentation built on June 10, 2018, 12:15 p.m.