The statistics card shows how the repositories of a GitHub user are
doing: their stars, how often they were viewed and cloned, the downloads
of their releases and their GitHub Actions runs. This article explains
each of its numbers and charts, and the options that change them. Get started shows how to collect your own
statistics and put the cards on your profile, and The contributions card and More cards explain the others.
example_stats() returns the made-up statistics of a user
named example-user, collected on 3 December 2026, so that
this article runs without a token. stats_card() draws their
card, as an SVG or a PNG file:
In an SVG shown in a web page, as here, each column and bar tells its
day or name and its value when you point at it. A GitHub profile shows
the card as an image, and so without that, as does a PNG.
The key figures
The row under the title has the key figures, each with its name above
the number and what it covers under it:
Figure
What it counts
Repositories
The repositories the user owns, the public ones that are not
forks.
Stars
The stars of these repositories, on the day of the collection.
Page views
The views of their pages on GitHub, in the days of the card.
Clones
How many times they were cloned, in the days of the card.
Release downloads
The downloads of the files of their releases, since each was
published.
Actions runs
The GitHub Actions runs of their workflows, in the days of the
card.
Release downloads and Actions runs appear only when the user has
releases or runs. Numbers from 1,000 on are rounded: 1.4K is about
1,400, and 12K about 12,000. Private repositories and forks are left out
unless collect_stats() was asked for them, with
include_private = TRUE and
include_forks = TRUE; the line under Repositories then says
“public and private”. A repository that was deleted or made private
since is left out of every figure and chart.
The days of the card
The page views, clones and runs are those of the last 30 days, which
days changes. The days end on the last full day, the day
before the collection: GitHub is still counting the day of the
collection, so its numbers would look low. The dates at the top right of
the card are the first and the last day.
GitHub keeps the page views and clones for 14 days only. The card
covers more days because collect_stats() keeps them in its
history: run at least once a week, it misses no day. Until the history
is as long as days, the card covers the days it has, and
says so: “last 14 days” after the first collection.
GitHub counts the traffic in UTC days, and for some repositories it
is a day behind the others. A day at either end of the history with the
traffic of half as many repositories as the day next to it, or fewer, is
left out, so that it does not look like a quiet day.
The card has up to three charts, side by side. panels
chooses them, from:
"views", "clones" and
"actions": the page views, clones or GitHub Actions runs of
each day, as columns. The busiest day has its number over its column,
and the first and the last day are under the axis.
"top_viewed" and "top_cloned": the five
repositories with the most page views or clones in the days of the card,
as bars, the largest first, with the number at the end of each bar.
"top_starred": the five repositories with the most
stars.
"languages": how many repositories have each main
language, the language that GitHub detects for most of the code of a
repository, as a ring with a legend of the shares: five languages at
most, and the rest together as “Other”, each in the colour that GitHub
gives the language. Repositories without code in a language that GitHub
knows are left out. The
contributions card has the same kind of ring for the commits.
A clone is a copy of a repository that git downloads. Most clones are
made by machines rather than people: every GitHub Actions run that
checks out a repository clones it, and so do package builders such as
R-universe and the services that deploy apps. A repository with a busy
workflow can have hundreds of clones a day without a single reader, so
the card says so under its charts.
The history also keeps the unique cloners of each day, in the
uniques column, which machines inflate less:
GitHub shows the page views and clones of a repository only to those
who can push to it, so collect_stats() reads them only with
a token of the user. For another user, or without such a token, the card
shows the forks instead of the page views and clones, and the GitHub
Actions runs, the most starred repositories and the languages as its
charts:
# dir = NULL keeps nothing on diskoctocat<-collect_stats(user ="octocat", dir =NULL)stats_card(octocat, "octocat-stats.svg")
Its days are then the last 30 up to the day before the collection, or
fewer while the history of runs is shorter: one collection reads the
runs of the last 14 days.
Theme, title and size
theme = "light" draws the card in the colours of
GitHub’s light mode, and "dark", the default, in those of
its dark mode. On a GitHub profile, a <picture>
element shows each reader the card of their mode (see Get started).
title replaces the user name and the name of the card
at the top left.
width is the width of the card in pixels, 900 by
default; its height follows. A PNG has twice as many pixels, so that it
stays sharp on high-resolution screens.
file names the file: an .svg, sharp at any
size and with the tooltips where a web page shows it, or a
.png, for places that take no SVG files.
file = NULL returns the SVG code, which is how this article
puts the cards in the page.
stats_card(stats, "rghcard-stats-light.svg", theme ="light", title ="My repositories")