plot_foodweb {ecostate} | R Documentation |
Plot foodweb
Description
Plot consumption as a directed graph including all taxa (vertices) and biomass consumed (arrows). Taxa are located using tracers, where by default the y-axis is trophic level. #'
Usage
plot_foodweb(
Q_ij,
type_i,
xtracer_i,
ytracer_i = rep(1, nrow(Q_ij)),
B_i = rep(1, nrow(Q_ij)),
taxa_labels = letters[1:nrow(Q_ij)],
xloc,
yloc
)
Arguments
Q_ij |
Consumption of each prey i by predator j in units biomass. |
type_i |
character vector indicating whether a taxon is "hetero", "auto", or "detritus" |
xtracer_i |
tracer to use when computing x-axis values |
ytracer_i |
tracer to use when computing y-axis values |
B_i |
biomass to use when weighting taxa in plot |
taxa_labels |
character vector of labels to use for each taxon |
xloc |
x-axis location (overrides calculation using |
yloc |
y-axis location (overrides calculation using |
Details
Trophic level l_i
for each predator i
is defined as:
\mathbf{l - 1 = l Q^*}
where \mathbf{Q*}
is the proportion consumption for each predator (column)
of different prey (rows). We identify primary producers as any taxa with no
consumption (a column of 0s), and assign them as the first trophic level.
Value
invisibly return ggplot
object for foodweb