What collect_stats(), read_stats() and get_example_stats() return: an
rghcard_stats object, a list of 14 data frames, one for each table of the history, which the
cards draw. Each table is also a CSV file in the folder of the history, such as views.csv.
Printing the statistics shows a summary; $ gets a table, such as stats$views, and
View(stats$views) shows it whole in RStudio or Positron.
Reading the tables
Types. Each column holds text, numbers, or
TRUEandFALSE. Days are text such as"2026-12-04", and times text such as"2026-12-04T05:17:03Z", both in UTC, as GitHub gives them;as.Date()turns either into a date. Years and the ids of runs are text too.Tables that grow, and tables replaced. Each collection adds its rows to most tables, and a row with the same identifying columns as an older one replaces it: the traffic of the day of a collection is still being counted, and the next collection brings the whole day. The tables
languages,stars,contributions,commitsandcontribution_typesare read whole, and replaced, at each collection.Unique visitors and cloners.
uniquesinviews,referrersandpagesis the unique visitors, and inclonesthe unique cloners; the totals oftrafficcall themvisitorsandcloners.Empty tables and missing values. A table that a collection could not fill, such as
viewswithout a token of the user, has no rows but keeps its columns.NAmarks a value that GitHub did not give, such as the main language of a repository without code.
The statistics also have three attributes, which attr() reads, such as
attr(stats, "updated"): user, the GitHub user name; updated, the day of the last
collection; and joined, the day the user joined GitHub, NA when unknown.
The tables
repos
The repositories of the user, one row for each repository on each day of collection, identified
by date and repo.
| Column | Type | What it holds |
date | text | The day of the collection. |
repo | text | The name of the repository. |
private | logical | Whether the repository is private. |
fork | logical | Whether it is a fork. |
archived | logical | Whether it is archived. |
stars | number | Its stars on that day. |
forks | number | Its forks. |
watchers | number | The users who watch it; NA in rows collected before rghcard 0.4.0. |
open_issues | number | Its open issues and pull requests, which GitHub counts together. |
size_mb | number | Its size in megabytes, as GitHub counts it. |
language | text | Its main language, the one GitHub detects for most of its code. |
last_push | text | The day of the last push to it. |
views
The page views of each repository per day, identified by repo and date. GitHub keeps 14
days; the history keeps every day collected.
| Column | Type | What it holds |
repo | text | The repository. |
date | text | The day. |
count | number | The page views of the day. |
uniques | number | The unique visitors of the day. |
clones
The clones of each repository per day, identified by repo and date, kept as the page views
are.
| Column | Type | What it holds |
repo | text | The repository. |
date | text | The day. |
count | number | The clones of the day. |
uniques | number | The unique cloners of the day. |
traffic
GitHub's totals of the 14 days it keeps, for each repository on each day of collection,
identified by fetched and repo. Someone who visits on several days counts once in them.
| Column | Type | What it holds |
fetched | text | The day of the collection. |
repo | text | The repository. |
views | number | The page views of the 14 days. |
visitors | number | Their unique visitors. |
clones | number | The clones of the 14 days. |
cloners | number | Their unique cloners. |
referrers
The ten sites that sent the most visitors to each repository in GitHub's 14 days, on each day
of collection, identified by fetched, repo and referrer.
| Column | Type | What it holds |
fetched | text | The day of the collection. |
repo | text | The repository. |
referrer | text | The site, such as google.com or github.com. |
count | number | The page views that it sent in the 14 days. |
uniques | number | The unique visitors that it sent. |
pages
The ten most viewed pages of each repository in GitHub's 14 days, on each day of collection,
identified by fetched, repo and path.
| Column | Type | What it holds |
fetched | text | The day of the collection. |
repo | text | The repository. |
path | text | The path of the page on GitHub, such as /example-user/tidysurvey/issues. |
title | text | The title of the page. |
count | number | Its page views in the 14 days. |
uniques | number | Its unique visitors. |
releases
The downloads of each file of each release, on each day of collection, identified by fetched,
repo, release and file. Releases without files are left out.
| Column | Type | What it holds |
fetched | text | The day of the collection. |
repo | text | The repository. |
release | text | The tag of the release, such as v1.2.0. |
file | text | The name of the file. |
downloads | number | Its downloads since the release was published. |
actions
The GitHub Actions runs of the repositories, one row per run, identified by id. Each
collection reads the runs of the last actions_days days of collect_stats(), and updates the
rows of the runs it had.
| Column | Type | What it holds |
id | text | GitHub's number of the run. |
repo | text | The repository. |
workflow | text | The name of the workflow, such as R-CMD-check. |
event | text | What started the run, such as push, pull_request or schedule. |
conclusion | text | How the run ended, such as success, failure or cancelled; NA while it runs. |
created | text | The time the run was created. |
started | text | The time it started; NA in rows collected before rghcard 0.4.0. |
finished | text | The time it ended; NA while it runs, and in rows collected before rghcard 0.4.0. |
languages
The code of each repository in each language, as the language bar of a repository counts it,
identified by repo and language. Replaced at each collection.
| Column | Type | What it holds |
repo | text | The repository. |
language | text | The language. |
bytes | number | The bytes of code in that language. |
stars
The stars of each repository per day, from GitHub's weekly history of them, which goes back to
the day the repository was created: a row for each day with stars, identified by repo and
date. Replaced at each collection. GitHub keeps only the stars still given, and counts these
days a few hours behind UTC, so a star given early in a day in UTC can be on the day before.
| Column | Type | What it holds |
repo | text | The repository. |
date | text | The day. |
count | number | The stars given that day. |
profile
The followers of the user, one row for each day of collection, identified by date.
| Column | Type | What it holds |
date | text | The day of the collection. |
followers | number | The users who follow the user. |
following | number | The users they follow. |
contributions
The contributions of the user on each day since they joined GitHub, as the contribution graph
of their profile counts them, identified by date. Replaced at each collection.
| Column | Type | What it holds |
date | text | The day. |
count | number | The contributions of the day. |
commits
The commits of the user in each repository each year, in repositories of anyone, identified by
year, owner and repo. Replaced at each collection. Private repositories and forks are
left out unless collect_stats() was asked for them, and GitHub gives 100 repositories a year
at most.
| Column | Type | What it holds |
year | text | The year, such as "2026". |
owner | text | The owner of the repository: the user, or someone else. |
repo | text | The repository. |
private | logical | Whether it is private. |
language | text | Its main language. |
commits | number | The commits of the user in it that year. |
contribution_types
The contributions of the user each year by type, identified by year. Replaced at each
collection.
| Column | Type | What it holds |
year | text | The year. |
commits | number | The commits. |
issues | number | The issues opened. |
pull_requests | number | The pull requests opened. |
reviews | number | The reviews of pull requests. |
repositories | number | The repositories created. |
private | number | The contributions to private repositories, which GitHub gives as bare numbers. |
See also
collect_stats() collects the statistics, read_stats() reads them again, and
plot_stats_card() and the other card functions draw them.
Examples
stats <- get_example_stats()
stats # a summary
#> GitHub statistics of example-user, collected until 2026-12-03
#> 8 repositories, 101 stars, traffic from 2026-11-03 to 2026-12-02, 4,132 contributions since 2019-03-14
#> Tables: repos (8 rows), views (240 rows), clones (240 rows), traffic (8 rows), referrers (12 rows), pages (9 rows), releases (4 rows), actions (87 rows), languages (15 rows), stars (100 rows), profile (1 row), contributions (2822 rows), commits (69 rows), contribution_types (8 rows)
#> Each table is a data frame, such as stats$views: ?rghcard_stats describes their columns.
names(stats) # the 14 tables
#> [1] "repos" "views" "clones" "traffic" "referrers" "pages" "releases" "actions" "languages"
#> [10] "stars" "profile" "contributions" "commits" "contribution_types"
head(stats$views) # one of them
#> repo date count uniques
#> 1 tidysurvey 2026-11-03 18 10
#> 2 tidysurvey 2026-11-04 11 6
#> 3 tidysurvey 2026-11-05 8 5
#> 4 tidysurvey 2026-11-06 21 9
#> 5 tidysurvey 2026-11-07 10 6
#> 6 tidysurvey 2026-11-08 4 3
attr(stats, "updated") # the day of the last collection
#> [1] "2026-12-03"
# the page views of all the repositories per day, the days as dates
views <- aggregate(count ~ date, data = stats$views, FUN = sum)
views$date <- as.Date(views$date)
head(views)
#> date count
#> 1 2026-11-03 47
#> 2 2026-11-04 30
#> 3 2026-11-05 26
#> 4 2026-11-06 53
#> 5 2026-11-07 22
#> 6 2026-11-08 9