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

Description Usage Arguments Value See Also Examples

View source: R/plot-bar.R

Description

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

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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")

Example output

Joining, by = "species"
Joining, by = "species"

atlantistools documentation built on Aug. 16, 2017, 9:05 a.m.