library("incidence")
library("ggplot2")
g <- sample(LETTERS[1:5], 100, replace = TRUE)
g <- factor(g, levels = LETTERS[5:1])
i <- incidence(rpois(100, 10), groups = g)
i
#> <incidence object>
#> [100 cases from days 1 to 20]
#> [5 groups: E, D, C, B, A]
#>
#> $counts: matrix with 20 rows and 5 columns
#> $n: 100 cases in total
#> $dates: 20 dates marking the left-side of bins
#> $interval: 1 day
#> $timespan: 20 days
#> $cumulative: FALSE
plot(i)
This will fix #77 and fix #78.
Created on 2018-11-14 by the reprex package (v0.2.1)