ISD_bin_plot: Recommended plots of individual size distribution and fit for...

View source: R/plotting.R

ISD_bin_plotR Documentation

Recommended plots of individual size distribution and fit for binned data with overlapping bins

Usage

ISD_bin_plot(
  data.year,
  b.MLE,
  b.confMin,
  b.confMax,
  year = NA,
  xlim = NA,
  xmin = NA,
  xmax = NA,
  yScaling = 0.75,
  MLE.round = 2,
  xLabel.small = c(5, 50, 500, 5000),
  yBig.inc = 1000,
  yBig.max = 10,
  ySmall.inc = NA,
  ySmall.tcl = -0.2,
  xLab = expression(paste("Body mass (", italic(x), "), g")),
  yLab = expression(paste("Number of ", values >= italic(x))),
  inset.a = c(0, 0),
  inset.year = c(0, 0.04),
  seg.col = "green",
  rect.col = "grey",
  fit.col = "red",
  fit.lwd = 2,
  conf.lty = 2,
  par.mfrow = c(2, 1),
  par.mai = c(0.4, 0.5, 0.05, 0.3),
  par.cex = 0.7,
  mgp.vals = c(1.6, 0.5, 0),
  IBTS_MEPS_figs = FALSE,
  x.PLB = NA
)

Arguments

data.year

tibble containing columns Year, wmin, wmax, Number, countGTEwmin, lowCount, highCount, for a single year (or instance) to show; Year not used, but no need to remove (it is in the results for the IBTS data). , countGTEwmin is, for a given bin, the total counts greater than that bin's wmin.

b.MLE

maximum likelihood estimate of b (ideally from the MLEbins method)

b.confMin

lower 95\

\item

b.confMaxupper 95\

\item

yearyear of data to go into legend (use NA if not applicable)

\item

xlim(soft) limits of x-axis. If NA then automatically uses the minimum wmin and maximum wmax for that data set (so it's good to set it globally when doing multiple years).

\item

xmin, xmax:values of xmin and xmax to plot the PLB curve

\item

yScalingScaling of y-minimum of y-axis. Axis can't go to zero on log-log plot, but goes to the proportion yScaling (which is less than 1) of the minimum value of counts greater than the highest wmin value. Do such that can see the right-most bin in all plots.

\item

MLE.roundnumber of decimal places to show MLE of b on the top plot

\item

xLabel.smallwhich small tickmarks to label on the x-axis

\item

yBig.incincrement for labelled big tickmarks on the unlogged y-axis

\item

yBig.maxmaximum number of desired labelled big tickmarks on the unlogged y-axis

\item

ySmall.incincrement for small unlabelled tickmarks on the y-axis (if NA then is set to yBig.inc/4)

\item

ySmall.tcllength of small y-axis tick marks - only for (a) maybe

\item

xLablabel for x-axis

\item

yLablabel for y-axis

\item

inset.ahow far to inset (a) and (b)

\item

inset.yearhow far to inset the year

\item

seg.colcolour for horizontal green lines showing range of body sizes for each bin

\item

rect.colcolour to fill in the rectangles for each bin

\item

fit.colcolour to plot the MLE curve, and those for the confidence intervals

\item

fit.lwdline weight for MLE curve

\item

conf.ltyline type for two curves for the MLE confidence intervals

\item

par.mfrowvector giving the layout of the figures (number of rows, number of columns)

\item

par.maimargin size in inches

\item

par.cexmagnification of plotting text and symbols relative to default

\item

mgp.valsmargin line for axis title, axis labels and axis line

\item

IBTS_MEPS_figslogical, TRUE for exactly reproducing the original MEPS Figures 7 and S.5-S.34 (which were done before some improvements to this function)

\item

x.PLBvector of values to use to plot the fitted PLB curve; if NA then automatically calculated two-panel figure of the recommended plot of binned data and the fitted individual size distribution, like Figures 7 and S.5-S.34 of the MEPS paper. See the vignette MEPS_IBTS_recommend for explicit example. Plots the individual size distribution and the fit from the MLEbins method, with linear and then logarithmic y-axes, in the recommended way that takes into account the bin structure of the data, as in Figures 7 and S.5-S.34 of the MEPS paper. Andrew Edwards


andrew-edwards/sizeSpectra documentation built on June 28, 2023, 7:09 p.m.