periods_of_change: Calculate and Plot Periods of Change in a non-linear curve

View source: R/periods_of_change.r

periods_of_changeR Documentation

Calculate and Plot Periods of Change in a non-linear curve

Description

Calculates and plots the episodic trends in a non-linear trend curve produced from a gam

Usage

periods_of_change(
  object,
  Term = "trendY",
  data,
  object.vars = c("pQ", "MA2days", "MAweek", "MAmonth", "MA6months", "MA12months",
    "trendY"),
  x_label = NULL,
  spacing = 5,
  nsamps = NULL,
  alpha = 0.05
)

Arguments

object

gam model produced from the mgcv R package

Term

term to calculate the periods of change over, typically a trend term

data

data used in the gam model, eg loaddata$CQ

object.vars

variables used in the gam fit.

x_label

label for the x-axis. If NULL, it will default to numbers starting at 1.

spacing

white space left between the labels. Defaults to 5.

nsamps

Typically NULL but can be a vector of the number of samples shown for each point in time.

alpha

significance level. Default is 0.05.


pkuhnert/LRE documentation built on June 9, 2025, 9:49 p.m.