Package 'forams'

Title: Foraminifera and Community Ecology Analyses
Description: SHE, FORAM Index and ABC Method analyses and custom plot functions for community data.
Authors: Rodrigo Aluizio
Maintainer: Rodrigo Aluizio <[email protected]>
License: GPL (>= 2)
Version: 2.0-6
Built: 2025-03-02 03:33:08 UTC
Source: https://github.com/godrigos/forams

Help Index


Foraminifera and Community Ecology Analyses

Description

SHE, FORAM Index and ABC Method analyses and custom plot functions for community data.

Details

Package: forams
Type: Package
Version: 2.0-6
Date: 2023-08-24
License: GLP (>=2)
Depends: methods, vegan, permute

This package always uses data frames with taxa as rows and sites or variables as columns. It also provides customizable plot functions to use with the objects resulting from the analyses, and randomly generated example datasets.

The analyses performed by this package are: SHE, FORAM Index and ABC Method.

Author(s)

Rodrigo Aluizio

Maintainer: Rodrigo Aluizio <[email protected]>

References

Buzas, M.A. & Hayek, L.A.C. (1998). SHE analysis for biofacies identification. Journal of Foraminiferal Research 28 (3), 233-239.

Hallock, P., Lidz, B.H., Cockey-Burkhard, E.M. & Donnelly, K.B. (2003). Foraminifera as bioindicators in coral reef assessment and monitoring: The foram index. Environmental monitoring and assessment 81, 221-238.

Warwick, R.M. (1986). A new method for detecting pollution effects on marine macrobenthic communities. Marine Biology 92 (4), 557-562.

Warwick, R.M., & Clarke, K.R. (1994). Relearning the ABC: taxonomic changes and abundance/biomass relationships in disturbed benthic communities. Marine Biology 118 (4), 739-744.

Wilson, B., Dawe, R., Gopee, A., Grant, S., Kissoon, A., Young, T., Noon, C., McLean, A. & Singh, K. (2010). Determining Boundaries between Abundance Biozones Using Minimal Equipment. International Journal of Ecology 2010, 1-14.

See Also

abc, fi, she

Examples

data(NB)
data(Factors)
data(LF)
# ABC
plot(abc(NB))
# FORAM Index
plot(fi(LF, Factors))
# SHE
plot(she(LF))

Abundance and Biomass Comparison Method

Description

This function performs the ABC and W statistic calculation.

Usage

abc(df, Perm, confInt)

Arguments

df

a numeric data frame containing the abundance and biomass as columns and taxa as rows. NAs are not allowed.

Perm

the number of permutations to be realized for calculating the Confidence Interval.

confInt

the Confidence interval range (90%, 95% or 99%, any other values will cause an error).

Details

The function generates a list of cumulative percentage values of Abundance, Biomass and Biomass - Abundance for each taxon (Warwick 1986), which are used for W statistic (Warwick & Clarke 1994) calculation and posterior k-dominance curve plotting.

Value

An abc S4 object has the fallowing elements:

An abc slot with:

Accum.Abun

The cumulative percentage of abundance contribution.

Accum.Biomass

The cumulative percentage of biomass contribution.

BiAi

Biomass - Abundance calculation results.

and a W.Stat slot with:

W.Stat

The result of the W statistic calculation and its Confidence Interval.

Note

The list elementes are ordered according to Accum.Abun, but the calculation is based on the contribution decreasing order, independently of any of the variables or taxon.

Author(s)

Rodrigo Aluizio

References

Warwick, R.M. (1986). A new method for detecting pollution effects on marine macrobenthic communities. Marine Biology 92 (4), 557-562.

Warwick, R.M., & Clarke, K.R. (1994). Relearning the ABC: taxonomic changes and abundance/biomass relationships in disturbed benthic communities. Marine Biology 118 (4), 739-744.

Examples

data(NB)
MyABC <- abc(NB)
plot(MyABC)

Class "abc"

Description

Class used to store "abc" analysis objects.

Objects from the Class

Objects can be created by calls of the form new("abc", ...). This class is composed by two slots, the first one stores a table with the abc analysis results and the second one the W Statistic result and its Confidence Interval.

Slots

abc:

Object of class "data.frame" ~~

W.Stat:

Object of class "numeric" ~~

Methods

plot

signature(x = "abc"): ...

Author(s)

Rodrigo Aluizio

See Also

See Also as abc

Examples

showClass("abc")

FORAM Index Factors

Description

An example dataset defining factors levels to use with the fi function.

Usage

data(Factors)

Format

A data frame with 29 observations on the following variable.

FI

a factor with levels: Ph, Po and Ps

Details

This dataset is an artificial random generated example. Unfortunately at the moment, due to authorship issues I can not present any real one. This may change in future versions.

Examples

data(Factors)
summary(Factors)

The FORAM Index

Description

This function implements the FORAM Index (FI) in community abundance datasets.

Usage

fi(df, groups)

Arguments

df

a numerical data frame with samples as columns and taxa as rows.

groups

a three level grouping factor.

Details

his analysis is directed for health evaluation and monitoring of reef environments (Hallock et al. 2003) and it is based in foraminiferal total fauna methodology.

The taxa classification that determines the groups are originally based on genera, but species data from literature or experiments will be accepted as well. The grouping factor must be composed solely by Ps (simbiont-bearing), Po (opportunistic), or Ph (other small heterotrophic) levels. NAs are not allowed.

The plot uses the axis function, so a complete customization (i.e. side) of the axes is not possible at this moment, and some other parameters may show improperly if changed.

Value

A fi object has the fallowing elements:

PlotOrder

a numerical vector defining the sites plot order, only used for plotting.

FI

a numerical vector with the sites FORAM Index values.

Note

FI > 4 indicates environment conducive to reef growth (CRG), FI varying between 3 and 5 indicates environmental change (Coefficient of Variation > 0.1), 2 < FI < 4 indicates environment marginal for reef growth (MRG) and unsuitable for recovery and FI < 2 indicates stressed conditions unsuitable for reef growth (UGR).

For more details on other graphic prameters see plot.default and par.

Author(s)

Rodrigo Aluizio

References

Hallock, P., Lidz, B.H., Cockey-Burkhard, E.M. & Donnelly, K.B. (2003). Foraminifera as bioindicators in coral reef assessment and monitoring: The foram index. Environmental monitoring and assessment 81, 221-238.

Examples

data(LF)
data(Factors)
MyFI <- fi(LF, Factors)
plot(MyFI)

Class "fi"

Description

Class used to store "fi" analysis objects.

Objects from the Class

Objects can be created by calls of the form new("fi", ...). Single slot classe used to store a "data.frame" object.

Slots

fi:

Object of class "data.frame" ~~

Methods

plot

signature(x = "fi"): ...

Author(s)

Rodrigo Aluizio

See Also

See Also as fi

Examples

showClass("fi")

FORAM Index and SHE dataset

Description

An example dataset containing some taxa abundances to use in exemples of the fi and she functions.

Usage

data(LF)

Format

A data frame with 29 taxa on 23 sites.

Details

This dataset is an artificial random generated example. Unfortunately at the moment, due to authorship issues I can not present any real one. This may change in future versions.

Examples

data(LF)
str(LF)

ABC Method Dataset

Description

An example dataset containing some taxa abundances and Biomasses to use in exemples of the abc function.

Usage

data(NB)

Format

A data frame with 316 taxa on the following 2 variables.

N

a numeric vector with abundance data.

Biomass

a numeric vector with biomass data.

Details

This dataset is an artificial random generated example. Unfortunately at the moment, due to authorship issues I can not present any real one. This may change in future versions.

Examples

data(NB)
str(NB)

~~ Methods for Function plot ~~

Description

~~ Methods for function plot ~~

Methods

signature(x = "abc")

An object of class "abc" resulting from and abc analysis.

signature(x = "ANY")

Other classes objects that will be handled by plot.default.

signature(x = "fi")

An object of class "fi" resulting from and fi analysis.

signature(x = "she")

An object of class "she" resulting from and she analysis.


Plot function for Abundance and Biomass Comparison Method objects.

Description

This function is a customizable plot for the abundance and biomass lines from the ABC object.

Usage

## S4 method for signature 'abc'
plot(x, xlim = c(0, ceiling(log(length(x@abc$Accum.Abund)))),
     ylim = c(0, 100), yaxp = c(0, 100, 10), lty.bio = 'dotted',
     lty.abu = 'solid', lwd = 2, col.bio = 'black', col.abu = 'black',
     xlab = expression('Species Rank'~(Log[e]~Scale)),
     ylab = 'Cumulative Dominance %', leg = TRUE, W = TRUE, col.pol = '#f5f5f5',
     ...)

Arguments

x

an object of class abc.

xlim

the x limits (x1, x2) of the plot, defaults from 0 to the maximum value of x (in a log scale).

ylim

the y limits (x1, x2) of the plot, defaults to c(0, 100)

yaxp

a vector of the form c(y1, y2, n) giving the coordinates of the extreme tick marks and the number of intervals between tick-marks, defaults to c(0, 100, 10).

lty.bio

line type of the biomass curve, defaults to "dotted".

lty.abu

line type of the abundance curve, defaults to "solid".

lwd

the line width, a positive number, defaulting to 2.

col.bio

the line color of the biomass curve, defaulting to "black".

col.abu

the line color of the abundance curve, defaulting to "black".

xlab

a label for the x axis, defaults to expression('Species Rank'~(Log[e]~Scale)).

ylab

a label for the y axis, defaults to "Cumulative Dominance %".

leg

logical; if TRUE draws a legend at the bottomright part of the plotting area, defaults to TRUE.

W

logical; if TRUE draws the W statistics value at the topleft part of the plotting area, defaults to TRUE.

col.pol

the polygon filling color, defaults to "#f5f5f5".

...

other graphical parameters, see par for details.

Details

The plot produces a two lines plot with a ln abscissa and uses the axis function, so a complete customization (i.e. side) of the axes is not possible at this moment.

Note

For more details on other graphic prameters such as line and box types see par and plot.default.

Author(s)

Rodrigo Aluizio

References

Warwick, R.M. (1986). A new method for detecting pollution effects on marine macrobenthic communities. Marine Biology 92 (4), 557-562.

Warwick, R.M., & Clarke, K.R. (1994). Relearning the ABC: taxonomic changes and abundance/biomass relationships in disturbed benthic communities. Marine Biology 118 (4), 739-744.

Examples

data(NB)
MyABC <- abc(NB)
plot(MyABC)

Custom plot function for FORAM Index results

Description

This function generates custom plots for FI objects.

Usage

## S4 method for signature 'fi'
plot(x, ylim = c(1, 10), yaxp = c(1, 10, 9), xlab = 'Samples',
  ylab = 'FORAM Index', pch.urg = 25, pch.mrg = 21, pch.crg = 24,
  bg.urg = 'red', bg.mrg = 'yellow', bg.crg = 'green', pt.cex = 1,
  limits = TRUE, ...)

Arguments

x

an object of class fi.

ylim

the y limits (x1, x2) of the plot, defaults to c(1, 10)

yaxp

a vector of the form c(y1, y2, n) giving the coordinates of the extreme tick marks and the number of intervals between tick-marks, defaults to c(1, 10, 9).

xlab

a label for the x axis, defaults to "Samples".

ylab

a label for the y axis, defaults to "FORAM Index".

pch.urg

plotting 'character', i.e., symbol to use, prefer one between 21:25, defaults to 25

pch.mrg

plotting 'character', i.e., symbol to use, prefer one between 21:25, defaults to 21

pch.crg

plotting 'character', i.e., symbol to use, prefer one between 21:25, defaults to 24

bg.urg

background (fill) color for the open plot symbols given by pch=21:25, defaults to "red".

bg.mrg

background (fill) color for the open plot symbols given by pch=21:25, defaults to "yellow".

bg.crg

background (fill) color for the open plot symbols given by pch=21:25, defaults to "green".

pt.cex

character (or symbol) expansion: a numerical vector, defaults to 1.

limits

logical; if TRUE, draws lines limiting the three FORAM Index classes and identifies them, defaults to TRUE.

...

other graphical parameters, see par for details.

Details

The plot uses the axis function, so a complete customization (i.e. side) of the axes is not possible at this moment, and some other parameters may show improperly if changed.

Note

FI > 4 indicates environment conducive to reef growth (CRG), FI varying between 3 and 5 indicates environmental change (Coefficient of Variation > 0.1), 2 < FI < 4 indicates environment marginal for reef growth (MRG) and unsuitable for recovery and FI < 2 indicates stressed conditions unsuitable for reef growth (UGR).

For more details on other graphic prameters see plot.default and par.

Author(s)

Rodrigo Aluizio

References

Hallock, P., Lidz, B.H., Cockey-Burkhard, E.M. & Donnelly, K.B. (2003). Foraminifera as bioindicators in coral reef assessment and monitoring: The foram index. Environmental monitoring and assessment 81, 221-238.

Examples

data(LF)
data(Factors)
MyFI <- fi(LF, Factors)
plot(MyFI)

Custom plot function for SHE Analysis objects

Description

This function generates customizable graphics for objects of the class she.

Usage

## S4 method for signature 'she'
plot(x, pch = 20, pcol = 'black', pcex = 1, pbg = 'black', lcol = 'black',
  lwd = 1, lty = 'dotted', ylab = expression('ln'~italic(E)), bty = 'l', ...)

Arguments

x

an object of class she.

pch

plotting 'character', i.e., symbol to use with the points, defaults to 20.

pcol

color code or name for plot symbols, defaults to "black".

pcex

character (or symbol) expansion: a numerical vector, defaults to 1.

pbg

background (fill) color for the open plot symbols given by pch=21:25, defaults to "black"

lcol

a specification for the default plotting color of the line, defaults to "black".

lwd

the line width, a positive number, defaulting to 1.

lty

the line type. Line types can either be specified as an integer (0=blank, 1=solid (default), 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash) or as one of the character strings "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash", where "blank" uses 'invisible lines' (i.e., does not draw them).

ylab

a label for the y axis, defaults to expression("ln" ~ italic(E)).

bty

box type drawn about the plot, defaults to "l". Other types will not reproduce ideally.

...

other parameters to be passed to plot.default.

Details

The plot produces a line plot with points on a ln abscissa and uses the axis function, so a complete customization (i.e. side) of the axes is not possible at this moment.

Note

For more details on other graphic prameters see par.

Author(s)

Rodrigo Aluizio

References

Buzas, M.A. & Hayek, L.A.C. (1998). SHE analysis for biofacies identification. Journal of Foraminiferal Research 28 (3), 233-239.

Wilson, B., Dawe, R., Gopee, A., Grant, S., Kissoon, A., Young, T., Noon, C., McLean, A. & Singh, K. (2010). Determining Boundaries between Abundance Biozones Using Minimal Equipment. International Journal of Ecology 2010, 1-14.

Examples

data(LF)
MySHE <- she(LF, "abun")
plot(MySHE)

SHE Analysis

Description

This function implements the SHE method in community abundance datasets.

Usage

she(df, method)

Arguments

df

a numerical data frame with samples as columns and taxa as rows.

method

the method to be used, ("abundance" or "frequency"), defaults to "abundance".

Details

This method is intended to determine boundaries between abundance biozones, based in raw abundance (SHEbi) or in frequency (SHEbip) (Buzas et al. 1998, Wilson et al. 2010). The custom plot produces a line plot with points on a ln abscissa and uses the axis function, so a complete customization (i.e. side) of the axes is not possible at this moment.

Value

S

richness values.

H

shannon diversity values.

E

equitability values.

N or L

number of specimens (N) or sites rank based on specimens frequency (L).

Note

This function implements great part of the process, but a small part must be caried out for the researcher when defining where to cut biozones before reruning the test. For more details on other graphic prameters see par.

Author(s)

Rodrigo Aluizio

References

Buzas, M.A. & Hayek, L.A.C. (1998). SHE analysis for biofacies identification. Journal of Foraminiferal Research 28 (3), 233-239.

Wilson, B., Dawe, R., Gopee, A., Grant, S., Kissoon, A., Young, T., Noon, C., McLean, A. & Singh, K. (2010). Determining Boundaries between Abundance Biozones Using Minimal Equipment. International Journal of Ecology 2010, 1-14.

Examples

data(LF)
MySHE <- she(LF, "abun")
plot(MySHE)

Class "she"

Description

Class used to store "she" analysis objects.

Objects from the Class

Objects can be created by calls of the form new("she", ...). Single slot classe used to store a "data.frame" object.

Slots

bi:

Object of class "data.frame" ~~

Methods

plot

signature(x = "she"): ...

Author(s)

Rodrigo Aluizio

See Also

See Also as she

Examples

showClass("she")