rmw_find_breakpoints: Function to detect breakpoints in a data frame using a linear...

View source: R/rmw_find_breakpoints.R

rmw_find_breakpointsR Documentation

Function to detect breakpoints in a data frame using a linear regression based approach.

Description

rmw_find_breakpoints will generally be applied to a data frame after rmw_normalise. rmw_find_breakpoints is rather slow.

Usage

rmw_find_breakpoints(df, h = 0.15, n = NULL)

Arguments

df

Tibble from rmw_normalise to detect breakpoints in.

h

Minimal segment size either given as fraction relative to the sample size or as an integer giving the minimal number of observations in each segment.

n

Number of breaks to detect. Default is maximum number allowed by h.

Value

Tibble with a date variable indicating where the breakpoints are.

Author(s)

Stuart K. Grange

Examples


# Test for breakpoints in an example normalised time series
data_breakpoints <- rmw_find_breakpoints(data_london_normalised)


rmweather documentation built on Nov. 21, 2023, 5:06 p.m.