Learn R Programming

atlantistools (version 0.4.3)

plot_bar: Function to plot relative contribution of biomass and numbers per cohort.

Description

Function to plot relative contribution of biomass and numbers per cohort.

Usage

plot_bar(data, x = "time", y = "atoutput", fill = "species",
  wrap = NULL, ncol = NULL)

Arguments

data

Dataframe to be plotted.

x

x-variable. Default is 'time'.

y

y-variable. Default is 'atoutput'.

fill

Column to use as filling colour. Default is "species".

wrap

Wraping column. Default is 'species'

ncol

Number of columns in multipanel plot. Default is 7.

Value

ggplot2 object

See Also

Other plot functions: plot_boxes, plot_diet_bec_dev, plot_diet, plot_line, plot_rec, plot_species

Examples

Run this code
# NOT RUN {
plot_bar(preprocess$biomass)

# Most models have a large number of groups. Please make sure to combine groups with a low
# contribution prior to plotting with \code{\link{combine_groups}}.
df <- combine_groups(preprocess$biomass, group_col = "species", combine_thresh = 3)
plot_bar(df)

# This function can also be used to plot age-specific data.
plot_bar(preprocess$nums_age, fill = "agecl", wrap = "species")

# Please use \code{\link{agg_perc}} to visualize the relative cohort structure over time.
df <- agg_perc(preprocess$nums_age, groups = c("time", "species"))
plot_bar(df, fill = "agecl", wrap = "species")
# }

Run the code above in your browser using DataLab