This is related to #77. If the user sets a factor level for the order of the groups, the incidence function clobbers that and rearranges the columns based on alphabetical order:
Brought up on the RECON slack channel, there was a question about the default
ordering of groups in plot.incidence(). It appears that the order of the
columns is not respected.
library("incidence")
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 3 to 20]
#> [5 groups: A, B, C, D, E]
#>
#> $counts: matrix with 18 rows and 5 columns
#> $n: 100 cases in total
#> $dates: 18 dates marking the left-side of bins
#> $interval: 1 day
#> $timespan: 18 days
#> $cumulative: FALSE
This is related to #77. If the user sets a factor level for the order of the groups, the incidence function clobbers that and rearranges the columns based on alphabetical order:
Brought up on the RECON slack channel, there was a question about the default ordering of groups in
plot.incidence()
. It appears that the order of the columns is not respected.Created on 2018-11-14 by the reprex package (v0.2.1)