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 = "sad",
  scale = "gamma",
  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, defaults to 'sad'.

scale

character string either 'alpha' for sample scale or 'gamma' for group scale. Defaults to 'gamma'.

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', log='x')
plot_abu(inv_mob_in, 'group', 'uninvaded', type='rad', scale = 'alpha', log='x')

MoBiodiv/mobr documentation built on Oct. 26, 2024, 10:51 a.m.