plot_trend: Create indicator trend plot

Description Usage Arguments Value See Also Examples

View source: R/plot_trend.R

Description

plot_trend creates for each indicator (IND) in the input tibble a time series plot including the smoothed trend with 95% confidence interval and the corresponding p- value based on the IND ~ time GAM.

Usage

1
plot_trend(trend_tbl, pos_label = "topleft")

Arguments

trend_tbl

Output tibble from the model_trend function.

pos_label

Specifies the position of the annotation in the plot. Should be one of "topleft" (default), "topright", "bottomleft" or "bottomright". For more details see place_text.

Value

The function returns a list of ggplot objects; one for each indicator.

See Also

model_trend that generates the model tibble for this function

Examples

1
2
3
4
5
6
7
8
# Using the example data
trend_tbl <- model_trend_ex
pt <- plot_trend(trend_tbl)
# Show single plots using indicator names or indices
pt[[2]]
pt$Sprat
# Show all plots together
gridExtra::grid.arrange(grobs = pt)

saskiaotto/INDperform documentation built on Oct. 27, 2021, 10:33 p.m.