Skip to contents

Use these options to add/modify a ggplot2 layer to plot_time_series(), representing the trend of the time series.

Usage

trend_options(..., trend = NULL, only_recent = FALSE, num_recent_years = 10)

Arguments

...

Named parameters to pass to the aesthetics of the ggplot2 layer that controls the trend visualization. In particular:

  • alpha

  • color

  • group

  • linetype

  • linewidth

trend

Which type of trend to add. One of NULL, "linear", or "median".

  • NULL: no trend is plotted

  • "linear": plots a linear regression

  • "median": plots median values of the historical baseline and/or "recent" years

only_recent

Whether to plot the trend only for the "recent" time period, defined by num_recent_years

num_recent_years

The number of years before the latest year to consider "recent"

Value

object of class KelpAreaIndicator_trend_options for use with plot_time_series()