plot_weight_at_age: Create a plot of weight-at-age lines by age and year

View source: R/plot_weight_at_age.R View source: R/plot-weight-at-age.R

plot_weight_at_ageR Documentation

Create a plot of weight-at-age lines by age and year

Description

Create a plot of weight-at-age lines by age and year

Plot weight-at-age data

Usage

plot_weight_at_age(data, maxage)

plot_weight_at_age(data, maxage)

Arguments

data

A data frame of weight-at-age values.

maxage

The maximum age in the modelled data.

wa

A data frame of weight-at-age with a yr column and numerically-named columns for ages

ages

A vector of ages to plot. If NULL, all ages in the wa data frame will be plotted

bold_ages

A vector of ages to make bold in the plot. The lines for these ages will be thicker and the labels for them will be bold as well

cols

A vector of colors to base the color ramp on. See ggplot2::scale_color_gradientn()

tick_prop

A value that the length of the major tick marks are multiplied by. This proportion must be set by trial and error. Make sure to change vjust_x_labels so the labels are not overlapping the lines or are too far away from the lines

vjust_x_labels

Adjustment to move the x-axis tick labels and label up or down. Negative numbers move down

remove_yr_labels

A vector of years to remove the ,labels for in case they are overlapping

x_lim

The min and max limits as a vector for the x-axis

y_lim

The min and max limits as a vector for the y-axis

y_lab_by

The amount between each y-axis label

x_labs_mod

How many years between year labels on the x-axis

age_label_font_size

The font size for the labels pointing to the age lines

age_label_side

Where to place the age labels next to the lines. One of "none", "both", "left", or "right"

x_labels_mod

Show every nth year where n is this number

...

Arguments passed to ggrepel::geom_label_repel()

Value

A ggplot2::ggplot() object

A ggplot2 object.

Author(s)

Kelli F. Johnson


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.