Skip to contents

Calls new_author_rate_tbl() for every source in POPULARITY_METRIC and row-binds the results, then plots each source's trailing-window rate over calendar time, one line per popularity stratum, faceted by source with a free y-scale per facet (sources sit on very different absolute rates, as in plot_cohort_age()). Unlike plot_step_change()/ plot_activity_by_source(), this builds its own multi-source table internally rather than taking one as tbl - new_author_rate_tbl() itself is single-source, matching issue_rate_tbl()/ author_density_tbl().

Usage

plot_new_author_rate(
  issue_authors_tbl,
  repo_tbl,
  source_display = NULL,
  n_strata = 4L,
  window = 12L,
  date_start = as.Date("2015-01-01"),
  date_end = NULL,
  start_year = NULL
)

Arguments

issue_authors_tbl

As returned by fetch_issue_authors().

repo_tbl

As returned by build_repo_tbl().

source_display

Named character vector as in plot_step_change().

n_strata, window, date_start, date_end

Passed to each source's new_author_rate_tbl() call.

start_year

Optional year to crop the plotted window to, as in plot_activity() - display-only, doesn't affect the underlying repo-months/rate calculations.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
plot_new_author_rate (issue_authors_tbl, repo_tbl, SOURCE_DISPLAY_NAME)
} # }