Skip to contents

Turns the days of an answer of GitHub's traffic API, of page views or clones, into rows of the history.

Usage

traffic_days(days, repo)

Arguments

days

The days of the answer: a list of records with timestamp, count and uniques.

repo

The name of the repository.

Value

A data frame of repo, date, count and uniques, one row per day, or NULL when there are no days.

Examples

days <- list(list(timestamp = "2026-12-01T00:00:00Z", count = 45, uniques = 9),
             list(timestamp = "2026-12-02T00:00:00Z", count = 10, uniques = 3))
rghcard:::traffic_days(days, "rwf")
#>   repo       date count uniques
#> 1  rwf 2026-12-01    45       9
#> 2  rwf 2026-12-02    10       3