Learn R Programming

risk.assessr (version 3.0.1)

get_commits_since: Retrieve GitHub Commits as Weekly Counts (using curl)

Description

This function fetches all commits from a specified GitHub repository using the GitHub API and returns a data frame with weekly commit counts.

Usage

get_commits_since(owner, repo, years = 1)

Value

A data frame with four columns:

week_start

Start date of the week (class Date).

year

Year of the commits.

month

Month of the commits.

n_commits

Number of commits during the week.

Arguments

owner

Character. The GitHub username or organization that owns the repository.

repo

Character. The name of the GitHub repository.

years

Numeric. Number of years to look back from today's date (default is 1).

Examples

Run this code
if (FALSE) {
# Get commit counts for the past year
get_commits_since(owner = "tidyverse", repo = "ggplot2")
}

Run the code above in your browser using DataLab