Learn R Programming

mobr (version 2.0.0)

plot_abu: Plot distributions of species abundance

Description

Plot distributions of species abundance

Usage

plot_abu(
  mob_in,
  env_var,
  type = c("sad", "rad"),
  pooled = FALSE,
  col = NULL,
  lwd = 3,
  log = "",
  leg_loc = "topleft"
)

Arguments

mob_in

a 'mob_in' class object produced by 'make_mob_in'

env_var

a string that specifies the column name in mob_in$env that specifies the grouping variable.

type

either 'sad' or 'rad' for species abundance vs rank abundance distribution

pooled

Boolean defaults to FALSE which specifies that abundances should not be pooled at the group level, TRUE specifies that they should be pooled

col

optional vector of colors.

lwd

a number which specifies the width of the lines

log

a string that specifies if any axes are to be log transformed, options include 'x', 'y' or 'xy' in which either the x-axis, y-axis, or both axes are log transformed respectively

leg_loc

a string that specifies the location of the legend, options include: 'lowerleft', 'topleft', 'loweright','topright'

Examples

Run this code
# NOT RUN {
data(inv_comm)
data(inv_plot_attr)
inv_mob_in = make_mob_in(inv_comm, inv_plot_attr, coord_names = c('x', 'y'))
plot_abu(inv_mob_in, 'group', type='sad', pooled=FALSE, log='x')
plot_abu(inv_mob_in, 'group', type='rad', pooled=TRUE, log='x')
# }

Run the code above in your browser using DataLab