Prepare statistics from the pulled commits data.
Usage
get_commits_stats(
commits,
time_aggregation = c("year", "month", "week", "day"),
group_var
)
Arguments
- commits
A
commits_data
table (output ofget_commits()
).- time_aggregation
A character, specifying time aggregation of statistics.
- group_var
Other grouping variable to be passed to
dplyr::group_by()
function apart fromstats_date
andgithost
. Could be:author
,author_login
,author_name
ororganization
. Should be passed without quotation marks.
Details
To make function work, you need first to get commits data with
GitStats
. See examples section.
Examples
if (FALSE) { # \dontrun{
my_gitstats <- create_gitstats() %>%
set_github_host(
token = Sys.getenv("GITHUB_PAT"),
repos = c("r-world-devs/GitStats", "openpharma/visR")
) |>
get_commits(my_gitstats, since = "2022-01-01") |>
get_commits_stats(
time_aggregation = "year",
group_var = author
)
} # }