plot_abu: Plot distributions of species abundance

View source: R/mobr.R

plot_abuR Documentation

Plot distributions of species abundance

Description

Plot distributions of species abundance

Usage

plot_abu(
  mob_in,
  group_var,
  ref_level = NULL,
  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'

group_var

String that specifies which field in mob_in$env the data should be grouped by

ref_level

String that defines the reference level of group_var to which all other groups are compared with, defaults to NULL. If NULL then the default contrasts of group_var are used.

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

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', 'uninvaded', type='sad', pooled=FALSE, log='x')
plot_abu(inv_mob_in, 'group', 'uninvaded', type='rad', pooled=TRUE, log='x')

MoBiodiv/mobr documentation built on Jan. 31, 2024, 6:15 p.m.