Either supply dfs_by_year (named list mapping year string /
integer to a data.frame) or df + year_col.
Details
Change-point detection is the manual largest-absolute-difference heuristic (the R port does not require changepoint).
Examples
inc <- morie_datasets_corrections_uof_incidents()
str(mrm_uof_yoy_change(df = inc, year_col = "year"), max.level = 1)
#> List of 12
#> $ title : chr "MRM-UOF Year-on-Year Change"
#> $ call : chr "mrm_uof_yoy_change(n_years=1)"
#> $ summary_lines :List of 5
#> $ warnings : chr "Only 1 year(s); too few for change-point detection."
#> $ interpretation : chr "Series spans 1 year(s) (2023-2023) with a total of 50 incident(s). Year-on-year volatility is undefined. No cha"| __truncated__
#> $ n : int 1
#> $ years : int 2023
#> $ counts : int 50
#> $ yoy_pct : num NA
#> $ change_point_year : int NA
#> $ change_point_method: chr "none"
#> $ mean_abs_yoy_pct : num NA
#> - attr(*, "class")= chr [1:3] "morie_mrm_uof_result" "morie_rich_result" "list"
