Package 'githubContributors'

Title: Ordering authorships for R packages hosted on GitHub
Description: Easily obtain and order GitHub user contributions, which helps with ordering authorships for R packages.
Authors: Rémi Thériault [aut, cre] (ORCID: <https://orcid.org/0000-0003-4315-6788>, Twitter: @rempsyc)
Maintainer: Rémi Thériault <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2026-05-27 09:51:37 UTC
Source: https://github.com/rempsyc/githubContributors

Help Index


Get GitHub contributions

Description

Get GitHub contributions, which can then be ordered with order_authors().

Usage

get_contributions(repo, user = "easystats")

Arguments

repo

A character vector of one or more repository names. When multiple repositories are provided (e.g., c("report", "insight")), the function returns a named list of data frames.

user

username

Value

When a single repository is provided, a data frame with username of contributor, number of added lines of code, deleted lines of code, and number of commits. When multiple repositories are provided, a named list of data frames, one for each repository.

Source

https://stackoverflow.com/a/75277425/9370662

Examples

head(get_contributions("report"))

Order GitHub authors

Description

Order GitHub authors based on contributions (obtained from get_contributions()).

Usage

order_authors(data, commit.weight = 0, cutoff = 1000)

Arguments

data

A data frame or a named list of data frames (as returned by get_contributions() when multiple repositories are provided).

commit.weight

A multiplication constant representing the weight the number of commits should have (setting it to 0, the default, will make it have no impact).

cutoff

Cutoff score under which to exclude contributors from the filtered list.

Value

When a single data frame is provided, a data frame with username of contributor, number of added lines of code, deleted lines of code, number of commits, and a total 'score' column representing the sum of the other columns. When a list of data frames is provided, a named list of data frames with the same structure.

Examples

x <- get_contributions("report")
order_authors(x)