View source: R/complete_dates.R
complete_dates | R Documentation |
This function ensures that an incidence object has the same range of dates
for each grouping. By default missing counts will be filled with 0L
.
complete_dates(x, expand = TRUE, fill = 0L, by = 1L, allow_POSIXct = FALSE)
x |
|
expand |
Should a range of dates from the minimum to maximum value of the date index also be created. If |
fill |
The value to replace missing counts by. Defaults to |
by |
Ignored. |
allow_POSIXct |
Should this function work with POSIXct dates? Defaults to |
An incidence2 object.
x <- data.frame(
dates = Sys.Date() + c(1,3,4),
groups = c("grp1","grp2", "grp1"),
counts = 1:3
)
i <- incidence(x, date_index = "dates", groups = "groups", counts = "counts")
complete_dates(i)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.