View source: R/propAbundPlots.R
propAbundPlots | R Documentation |
#Make proportional abundance bar-plots, with a rank-order smoothing line
propAbundPlots(
d,
s,
N,
textYRange = c(0.5, 0.9),
by = NULL,
Ncol = NA,
Nrow = NA
)
d |
Data frame or tibble |
s |
Species label column |
N |
Species count column |
textYRange |
Numeric vector with proportional y-range for plot text (default: c(0.5, 0.9)) |
by |
Faceting column - usually site (default: NULL) |
Ncol |
Number of columns, if using facets |
Nrow |
Number of rows, if using facets |
A ggplot
object
data(dune,package='vegan')
library(tidyverse)
dune <- dune %>% mutate(site=1:nrow(.)) %>%
pivot_longer(cols = -site,names_to='species',values_to='counts')
propAbundPlots(dune,s = species,N = counts)
filter(dune,site<10) %>% #First 9 sites
propAbundPlots(s = species,N = counts, by = site, Nrow=3, Ncol=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.