barplotRichness: barplotRichness

barplotRichnessR Documentation

barplotRichness

Description

Makes a barplot of species richness

Usage

barplotRichness(
  object,
  byPark = F,
  byYear = F,
  byPoint = F,
  byGuild = F,
  includeNA = T,
  colors = "dark green",
  palette = "BuGn",
  plot_title = NA,
  scale = T,
  labels = T,
  output = "total",
  plot = TRUE,
  ...
)

Arguments

object

An NCRNbirds object a list of such objects, or a data.frame like that produced by birdRichness.

byPark

Defaults to FALSE. If true the barplot will have on bar for each park.

byYear

Defaults to FALSE. If true the barplot will have on bar for each year.

byPoint

Defaults to FALSE. If TRUE the barplot will have one bar for each point.

byGuild

Defaults to FALSE. If TRUE the barplot will be stacked by Guild.

includeNA

Defaults to TRUE. If byGuild = T and includeNA=F then speices which have a response guild of NA will not be included in the bar chart.

colors

One or more colors for the bars.

palette

Color pallete for the background of the graph. Defaults to "BuGn" (blue green) but will accept any RColorBrewer palette

plot_title

Optional, A title for the plot.

scale

If TRUE will include a scale to the right of the barplot.

labels

IfTRUE will label species richness values on the barplot.Labels are never shown wehen plotting by guild.

output

Either "total" (the default) or "list". Only used when object is a list

plot

Logical. Return plot TRUE (default) or data.frame FALSE.

...

Additional arguments passed to birdRichness

Details

This function produces a barplot of species richness by Park, Year or Point. It does this by using the output of the birdRichness function. The data is then passed on to ggplot2 for graphing. The user can chose to have byPark=T, byYear=T or byPoint=T, but should only pick one of the three. These can be combined with a guild category using byGuild. The includeNA argument indicates if bird species that are not categorized for a particular guild shoud be included.

Colors:

Colors of the bars are controlled by either colors or palette argumnts. If the barplot is not by guild then the color indicated by colors will be used. If byGuild=T then by default the palette arguement will be used. However, the palette arguement can be overridden simply by giving colors a vector of colors with one color for each guild category shown in the barplot.If includeNA=T than than the first color will correspond to the NA value.


NCRN/NCRNbirds documentation built on Aug. 28, 2023, 12:12 p.m.