reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

Add plotting support for text-based intervals #50

Closed zkamvar closed 6 years ago

zkamvar commented 6 years ago

In #43, stable datetime support was added, which meant that strings such as "day", "week", "month", etc could be used to define intervals. This PR adds plotting support for these strings and allows for variable width intervals in the plot at least.

Things fixed/added:

Things that may still need to be done, but don't necessarily have to be done for this PR to be pulled:

Example

library("incidence")
library("outbreaks")
d <- ebola_sim_clean$linelist$date_of_onset
plot(incidence(d, interval = "day"))

plot(incidence(d, interval = "week"))

plot(incidence(d, interval = "month"))

plot(incidence(d, interval = "quarter"))

Created on 2018-07-12 by the reprex package (v0.2.0).

thibautjombart commented 6 years ago

I think the travis failing is an encoding issue in the doc - can you check? See log below.

* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking re-building of vignette outputs ... OK
* DONE
Status: 1 WARNING
See
  ‘/home/travis/build/reconhub/incidence/incidence.Rcheck/00check.log’
for details.
0.46schecking Rd files ... WARNING
estimate_peak.Rd: non-ASCII input and no declared encoding
problem found in ‘estimate_peak.Rd’