coverpred: ~~ Methods for Function 'coverpred' in Package 'sads' ~~

coverpred-methodsR Documentation

~~ Methods for Function coverpred in Package sads ~~

Description

Creates an object of coverpred-class with the number of species in each abundance class predicted by a species abundance distribution.

Arguments

object

an object of class fitsadC or histogram; fitted model of species abundances distributions. Alternatively a histogram with number of species in each abundance class.

sad

character; root name of sad distribution to calculate expected percentiles. See fitsadC for available distributions.

coef

named list of numeric values; parameter values of the distribution given in sad. Parameters should be named as in the corresponding density function, and in the same order.

trunc

non-negative integer, trunc > min(x); truncation point if fitted distribution is truncated.

breaks

real vector; breakpoints of abundance classes.

mids

real vector; breakpoints of abundance classes.

S

integer; total number of species.

Methods

signature(object = "fitsadC", sad = "missing", coef = "missing", trunc = "missing", breaks = "missing", mids = "missing", S = "missing")

number of species in each abundance class predicted from a sads model fitted with function fitsadC.

signature(object = "histogram", sad = "character", coef = "list", trunc = "ANY", breaks = "missing", mids = "missing", S = "missing")

number of species in each abundance class predicted from abundance distribution named by sad with parameters defined in coef. Number of species S and intervals of the abundance classes defined are given by histogram.

signature(object = "missing", sad = "character", coef = "list", trunc = "ANY", breaks = "numeric", mids = "ANY", S = "numeric")

number of species each abundance class predicted from abundance distribution named by sad with parameters defined in coef, number of species S defined in S. Abundance classes are defined by their breakpoints (breaks) or by their midpoints (mids).

Author(s)

Paulo I. Prado prado@ib.usp.br

Examples

## Example of fitting a sad model to cover data 
## Abundance classes: cover scale for plants
Lbrk <- c(0,1,3,5,15,25,35,45,55,65,75,85,95,100)
## To fit a sad model to cover data, data sould be in histogram format
grass.h <- hist(grasslands$mids, breaks = Lbrk, plot = FALSE)
## Fits a Pareto distribution to the histogram object
grass.p <- fitparetoC(grass.h)
## Values (densities, frequencies, relative frenquecies) predicted by the model for each size class
grass.p.pred <- coverpred(grass.p)
## Plot histogram of observed values in density scale
plot(grass.h)
## adds points for the predicted values (predicted densities)
points(grass.p.pred)
## Predicted values for the same data but other parameter values
grass.p.pred2 <- coverpred(grass.h, sad = "pareto", coef = list(shape = 1, scale = 0.5)) 
## Adds the new predicted values to the plot
points(grass.p.pred2, col = "red") 

sads documentation built on June 22, 2024, 12:18 p.m.