plotSiberObject: Creates an isotope scatterplot and provides a wrapper to...

View source: R/plotSiberObject.R

plotSiberObjectR Documentation

Creates an isotope scatterplot and provides a wrapper to ellipse and hull plotting

Description

This function takes a SIBER object as created by createSiberObject, and loops over communities and their groups, creating a scatterplot, and adding ellipses and hulls as desired. Ellipses can be added to groups, while convex hulls can be added at both the group and community level (the former for illustrative purposes only, with no analytical tools in SIBER to fit Bayesian hulls to individual groups. This is not mathematically possible in a Bayesian framework.).

Usage

plotSiberObject(
  siber,
  iso.order = c(1, 2),
  ax.pad = 1,
  hulls = TRUE,
  community.hulls.args = NULL,
  ellipses = TRUE,
  group.ellipses.args = NULL,
  group.hulls = FALSE,
  group.hulls.args = NULL,
  bty = "L",
  xlab = "Isotope 1",
  ylab = "Isotope 2",
  las = 1,
  x.limits = NULL,
  y.limits = NULL,
  points.order = 1:25,
  ...
)

Arguments

siber

a siber object as created by createSiberObject().

iso.order

a vector of length 2, either c(1,2) or c(2,1). The order determines which of the columns of raw data are plotted on the x (1) or y (2) axis. N.B. this will be deprecated in a future release, and plotting order will be achieved at point of data-entry.

ax.pad

a padding amount to apply to the x-axis either side of the extremes of the data. Defaults to 1.

hulls

a logical defaulting to TRUE determining whether or not hulls based on the means of groups within communities should be drawn. That is, a community-level convex hull.

community.hulls.args

a list of plotting arguments to pass to plotCommunityHulls(). See plotCommunityHulls() for further details.

ellipses

a logical defaulting to TRUE determining whether or not an ellipse should be drawn around each group within each community.

group.ellipses.args

a list of plotting arguments to pass to plotGroupEllipses(). See plotGroupEllipses() for further details.

group.hulls

a logical defaulting to FALSE determining whether or not convex hulls should be drawn around each group within each community.

group.hulls.args

a list of plotting options to pass to plotGroupHulls(). See plotGroupHulls() for further details.

bty

a string specifying the box type for the plot. See graphics::par() for details.

xlab

a string for the x-axis label.

ylab

a string for the y-axis label.

las

a scalar determining the rotation of the y-axis labels. Defaults to horizontal with las = 1. See graphics::par() for more details.

x.limits

allows you to specify a two-element vector of lower and upper x-axis limits. Specifying this argument over-rides the automatic plotting and ax.pad option. Defaults to NULL.

y.limits

allows you to specify a two-element vector of lower and upper y-axis limits. Specifying this argument over-rides the automatic plotting and ax.pad option. Defaults to NULL.

points.order

a vector of integers specifying the order of point types to use. See graphics::points() for how integers map onto point types. Defaults to the sequence 1:15 as per graphics::points(). It must have at least as many entries as there are communities to plot, else a warning will be issued, and the order will default to the sequence 1:25.

...

additional arguments to be passed to graphics::plot().

Value

An isotope scatterplot.


SIBER documentation built on Oct. 19, 2023, 5:09 p.m.