LDPlot: A Comparative Live-Dead Barplot

View source: R/LDPlot.R

LDPlotR Documentation

A Comparative Live-Dead Barplot

Description

LDPlot function generates a comparative live-dead plot to visualize congruence in relative abundance and rank order of the most common live and dead species, genera, functional groups or other enumerated variables.

Usage

LDPlot(
  live,
  dead,
  tax.names,
  toplimit = 10,
  barwidth = 250/toplimit,
  col1 = "black",
  col2 = "gray",
  arr.col = "black",
  arr.lty = 1,
  arr.lwd = 1,
  cex.axis = 0.7,
  tck = -0.02,
  cex.lab = 0.8,
  cex.names = 0.95,
  cex.label = 1,
  cex.stat = 0.9,
  font.names = 3,
  cor.measure = "spearman",
  report = F,
  iter = 100
)

Arguments

live

A vector of integers with counts of live specimens by species/other units

dead

A vector of integers with counts of dead specimens by species/other units

tax.names

A vector with a list of names of species/other units

toplimit

A numerical value (default = 10) defining the number of top species (or other units) to be plotted

barwidth

A numerical value (default = 250 / toplimit) defining bar width (the thickness of lines used to represent bars)

col1

A character string (default = 'black') defining the color of bars for species/variables shared by live and dead data

col2

A character string (default = 'gray') defining the color of bars for species/variables unique to either live or dead data

arr.col

A character string (default = 'black') defining the color of arrows

arr.lty

An integer or character string specifying type of line used for arrows (default = 1)

arr.lwd

A numerical value specifying the width of arrow lines (default = 1)

cex.axis

A numerical value (default = 0.7) defining font size of tick mark labels

tck

A numerical value (default = -0.02) defining length of tick marks for x axis

cex.lab

A numerical value (default = 0.8) defining font size for x-axis label

cex.names

A numerical value (default = 0.95) defining font size for names of species/other units

cex.label

A numerical value (default = 1) defining font size for 'Live' and 'Dead' titles

cex.stat

A numerical value (default = 0.9) defining font size for correlation coefficient estimate

font.names

A numerical value (default = 3) defining font style

cor.measure

A character string (default='spearman') defining correlation measure (passed on to cor function) used to estimate live-dead correlations. Possible values are 'pearson', 'spearman', 'kendall', 'all'. Reported coefficients include all taxa regardless of how many taxa are included on the plot

report

Logical (default = FALSE) to print a summary output

iter

Numerical (default = 100) number of iterations for randomization which simulates perfect fidelity by resampling pooled live+dead species counts. Applicable only when the argument "report" is set to TRUE

Details

LDPlot function produces a dual barplot that compares rank abundance of one live sample with one dead sample for the top "n" most common species, genera, or other units (e.g., Kowalewski et al. 2003). The L-D comparison can apply to single samples or pooled data. Because names of species/other units can vary in length and the number of plotted variables can span a wide range of values, margin widths and cex argument may need to be customized. When species/other units are tied in rank, they are plotted in an arbitrary order. A warning is returned when more than 50

Value

A single plot. In addition, when the argument "report" is set to TRUE, a list with the following components is produced:

top.live

a list of top live species, including proportions and presence/absence in dead data

top.dead

a list of top dead species, including proportions and presence/absence in live data

summary

summary of species/taxa numbers in live, data, and pooled data

sample info

samples sizes in live, data, and pooled data

cor.coeff

observed coefficients of correlation/association

expected.coeff

expected coefficients of correlation/association estimated via randomization under the null model that the compared live and dead samples came from the same underlying population (perfect fidelity)

p.values

p.values for perfect fidelity null model based on percentile estimates of the resampling distribution

randomized.r

coefficients of correlation/association produced by the randomization model

References

Kowalewski, M., Carroll, M., Casazza, L., Gupta, N., Hannisdal, B., Hendy, A., Krause, R.A., Jr., Labarbera, M., Lazo, D.G., Messina, C., Puchalski, S., Rothfus, T.A., Sälgeback, J., Stempien, J., Terry, R.C., Tomašových, A., (2003), Quantitative fidelity of brachiopod-mollusk assemblages from modern subtidal environments of San Juan Islands, USA. Journal of Taphonomy 1: 43-65.

Examples


temp.par <- par(mar=c(3,6,1,6))
out1 <- LDPlot(live=colSums(FidData$live), dead=colSums(FidData$dead),
tax.names=colnames(FidData$live), toplimit=15, barwidth = 21,
col1 = 'green1', col2 = 'red1', arr.col = 'green4', arr.lty = 1,
report=TRUE, iter=100)
par(temp.par)
hist(out1$randomized.r[,2], main='', xlim=c(-1,1),
xlab=bquote("spearman"~rho), ylab='number of replicate samples')
arrows(out1$cor.coeff[2], 10, out1$cor.coeff[2], 0, length = 0.15, lwd=2)
text(out1$cor.coeff[2], 12, bquote(rho ==.(round(out1$cor.coeff[2],3))))


MJKowalewski/PaleoFidelity documentation built on Aug. 25, 2024, 8:27 p.m.