For each of several sources, compare each popularity stratum's trailing 12-month rate at a fixed reference month against its most recent value. A fixed reference month (rather than each stratum's own peak) is used deliberately: individual per-stratum peaks are noisy, especially for sparser low-popularity strata where a single active month can dominate a small repo-month denominator, so anchoring on one shared calendar month both avoids cherry-picking and keeps strata/sources comparable.
Usage
step_change_tbl(
issue_authors_tbl,
repo_tbl,
sources,
n_strata = 4L,
metric = "issues",
contrib_threshold = 0.01,
window = 12L,
ref_date = as.Date("2021-01-01")
)Arguments
As returned by
fetch_issue_authors().- repo_tbl
As returned by
build_repo_tbl().- sources
Character vector of
source_namevalues to include (seeissue_rate_tbl()).- n_strata
Number of popularity strata, passed to
issue_rate_tbl().n_strata = 1pools every repo into a single, unstratified rate and dropspopularity_stratumfrom the returned tibble.- metric, contrib_threshold, window
Passed to
issue_rate_tbl().- ref_date
Reference
Date(first-of-month) to compare against the latest available month.
Value
A tibble: source, popularity_stratum, rate_ref,
rate_latest, step_change (rate_latest / rate_ref), latest_month.
Examples
if (FALSE) { # \dontrun{
fc <- step_change_tbl (issue_authors_tbl, repo_tbl, c ("cran", "npm"))
plot_step_change (fc)
} # }