Learn R Programming

analogue (version 0.17-7)

sppResponse: Species responses along gradients.

Description

The fitted responses of species along gradients are estimated or extracted from appropriate objects.

Usage

sppResponse(x, ...)

# S3 method for prcurve sppResponse(x, n = 100, ...)

Value

A list is returned with components observed and

fitted.values containing the observed and fitted values of the species response and gradient respectively. Each is a list with two components, gradient and response, containing the gradient and response values.

Arguments

x

an R object.

n

numeric; the number of locations on the gradient to evaluate the response curve.

...

additional arguments passed to other methods.

Author

Gavin L. Simpson

Details

sppResponse estimates species responses along indicated gradients.

There is currently no "default" method and the only specified method supplied is for objects fitted by prcurve. This method extracts the fitted responses of species along the principal curve and is a useful diagnostic for identifying overly-complex curves.

See Also

prcurve for one function that can be used with sppResponse. A plot method is available; see plot.sppResponse for details.

Examples

Run this code
## Load the Abernethy Forest data set
data(abernethy)

## Remove the Depth and Age variables
abernethy2 <- abernethy[, -(37:38)]

## Fit the principal curve using varying complexity of smoothers
## for each species
aber.pc <- prcurve(abernethy2, method = "ca", trace = TRUE,
                   vary = TRUE, penalty = 1.4)

## Extract the fitted species response curves
resp <- sppResponse(aber.pc)

## Look at only the most abundant/frequently occurring taxa
take <- chooseTaxa(abernethy2, max.abun = 25, n.occ = 10, value = FALSE)
layout(matrix(1:12, ncol = 3))  	# split device into panels 
plot(resp, which = take)
layout(1)				# reset device

Run the code above in your browser using DataLab