Skip to contents

Reads the history that collect_stats() keeps in a folder.

Usage

read_stats(dir = "rghcard-data")

Arguments

dir

Folder of the history.

Value

An rghcard_stats object: a list of the data frames of the history, which collect_stats() describes, with the user, the day of the last collection and the day the user joined GitHub as the attributes user, updated and joined.

See also

collect_stats() collects the statistics and describes each table, and stats_card() and the other card functions draw them.

Examples

stats <- read_stats(system.file("extdata", "example", package = "rghcard"))
stats
#> 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 (101 rows), profile (1 rows), contributions (2822 rows), commits (69 rows), contribution_types (8 rows) 
head(stats$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