Skip to contents

Picks the numbers that the cards show from the statistics: the repositories of the last collection, the traffic and the runs of the last days days up to the last full day collected, the downloads of the last collection, and, from contribution_data(), the contributions.

Usage

card_data(stats, days)

Arguments

stats

Statistics, an rghcard_stats object.

days

The days of the traffic and the runs.

Value

A list: user, latest (the repositories of the last collection), views, clones and actions (their rows in the days of the card; the runs with the minutes they took), has_actions, releases, traffic (whether there is any), totals, referrers and pages (the 14 days of GitHub's traffic at the last collection that read it), languages, stars, profile (the followers at the last collection), types (the contributions by type), start, end and ndays (the days of the card), updated (the day of the collection), and the elements that contribution_data() returns.

Examples

d <- rghcard:::card_data(example_stats(), 30)
c(d$start, d$end)
#> [1] "2026-11-03" "2026-12-02"
head(d$views)
#>         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