Skip to contents

Totals the rows of each day from start to end, with 0 on the days without rows.

Usage

daily(df, start, end, value = NULL)

Arguments

df

Rows with a date, as text.

start, end

The first and the last day, dates.

value

The column to total, or NULL to count the rows.

Value

A data frame of date and value, one row per day.

Examples

views <- data.frame(date = c("2026-12-01", "2026-12-03", "2026-12-03"), count = c(5, 2, 4))
rghcard:::daily(views, as.Date("2026-12-01"), as.Date("2026-12-04"), "count")
#>         date value
#> 1 2026-12-01     5
#> 2 2026-12-02     0
#> 3 2026-12-03     6
#> 4 2026-12-04     0
rghcard:::daily(views, as.Date("2026-12-01"), as.Date("2026-12-04"))
#>         date value
#> 1 2026-12-01     1
#> 2 2026-12-02     0
#> 3 2026-12-03     2
#> 4 2026-12-04     0