autoplot.prc: ggplot-based plot for objects of class '"prc"'

autoplot.prcR Documentation

ggplot-based plot for objects of class "prc"

Description

Produces a multi-layer ggplot object representing the output of objects produced by prc.

Usage

## S3 method for class 'prc'
autoplot(
  object,
  select,
  xlab,
  ylab,
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  legend.position = "top",
  ...
)

Arguments

object

an object inheriting from class "prc", the result of a call to prc.

select

a logical vector where TRUE selects and FALSE deselects species. Alternatively a numeric vector that contains the indices selecting species. Note that these are with respect to the original species matrix, not the fortified object.

xlab

character; label for the x-axis

ylab

character; label for the y-axis

title

character; subtitle for the plot

subtitle

character; subtitle for the plot

caption

character; caption for the plot

legend.position

character; position for the legend grob. See argument legend.position in function theme.

...

Additional arguments passed to fortify.prc.

Details

TODO

Value

Returns a ggplot object.

Author(s)

Gavin L. Simpson

Examples

data(pyrifos)
week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24))
dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11))

## Fit PRC model
mod <- prc(pyrifos, dose, week)

## plot
want <- colSums(pyrifos)
autoplot(mod, select = want)

gavinsimpson/ggvegan documentation built on July 28, 2023, 9:24 a.m.