Software Open Access

reconhub/incidence: Incidence version 1.7.0

Thibaut Jombart; Zhian N. Kamvar; Jun Cai; Juliet Pulliam; Sarah Chisholm; Rich FitzJohn; Jakob Schumacher; Sangeeta Bhatia


Dublin Core Export

<?xml version='1.0' encoding='utf-8'?>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
  <dc:creator>Thibaut Jombart</dc:creator>
  <dc:creator>Zhian N. Kamvar</dc:creator>
  <dc:creator>Jun Cai</dc:creator>
  <dc:creator>Juliet Pulliam</dc:creator>
  <dc:creator>Sarah Chisholm</dc:creator>
  <dc:creator>Rich FitzJohn</dc:creator>
  <dc:creator>Jakob Schumacher</dc:creator>
  <dc:creator>Sangeeta Bhatia</dc:creator>
  <dc:date>2019-03-14</dc:date>
  <dc:description>Incidence can now handle standardised weeks starting on any day thanks to the aweek package :tada:
library(incidence)
library(ggplot2)
library(cowplot)
d &lt;- as.Date("2019-03-11") + -7:6
setNames(d, weekdays(d))
#&gt;       Monday      Tuesday    Wednesday     Thursday       Friday 
#&gt; "2019-03-04" "2019-03-05" "2019-03-06" "2019-03-07" "2019-03-08" 
#&gt;     Saturday       Sunday       Monday      Tuesday    Wednesday 
#&gt; "2019-03-09" "2019-03-10" "2019-03-11" "2019-03-12" "2019-03-13" 
#&gt;     Thursday       Friday     Saturday       Sunday 
#&gt; "2019-03-14" "2019-03-15" "2019-03-16" "2019-03-17"
imon &lt;- incidence(d, "mon week") # also ISO week
itue &lt;- incidence(d, "tue week")
iwed &lt;- incidence(d, "wed week")
ithu &lt;- incidence(d, "thu week")
ifri &lt;- incidence(d, "fri week")
isat &lt;- incidence(d, "sat week")
isun &lt;- incidence(d, "sun week") # also MMWR week and EPI week

pmon &lt;- plot(imon, show_cases = TRUE, labels_week = FALSE)
ptue &lt;- plot(itue, show_cases = TRUE, labels_week = FALSE)
pwed &lt;- plot(iwed, show_cases = TRUE, labels_week = FALSE)
pthu &lt;- plot(ithu, show_cases = TRUE, labels_week = FALSE)
pfri &lt;- plot(ifri, show_cases = TRUE, labels_week = FALSE)
psat &lt;- plot(isat, show_cases = TRUE, labels_week = FALSE)
psun &lt;- plot(isun, show_cases = TRUE, labels_week = FALSE)

s &lt;- scale_x_date(limits = c(as.Date("2019-02-26"), max(d) + 7L))
plot_grid(
pmon + s,
ptue + s,
pwed + s,
pthu + s,
pfri + s,
psat + s,
psun + s)


multi-weeks/months/years can now be handled
library(incidence)
library(outbreaks)
d &lt;- ebola_sim_clean$linelist$date_of_onset
h &lt;- ebola_sim_clean$linelist$hospital

plot(incidence(d, interval = "1 epiweek", group = h))


plot(incidence(d, interval = "2 epiweeks", group = h))


plot(incidence(d, interval = "3 epiweeks", group = h))


plot(incidence(d, interval = "2 months", group = h))


&lt;sup&gt;Created on 2019-03-14 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)&lt;/sup&gt;
Full set of changes
NEW FEATURES

Any interval seq.Date() can handle (e.g. "5 weeks") can be handled by
incidence() (see https://github.com/reconhub/incidence/issues/67)
Weekly intervals can start on any day of the week by allowing things like 
"epiweek", "isoweek", "wednesday week", "2 Saturday weeks", etc.
(see https://github.com/reconhub/incidence/issues/55#issuecomment-405297526)
the item $weeks is now added to the incidence object, which contains an
"aweek" class
plotting will now force the first tick to be the starting point of the
incidence curve

NEW FUNCTIONS

make_breaks() will automatically calculate breaks from an incidence object
for plotting. 
scale_x_incidence() will produce a ggplot2 "ScaleContinuous" object to add
to a ggplot.

DEPRECATED

plot.incidence() argument labels_iso is deprecated in favor of 
labels_week
Incidence objects will still have $isoweeks if the weeks are ISO 8601
standard, but users should rely intead on $weeks instead. The $isoweeks
element will be removed in a future version of incidence.
as.incidence() argument isoweeks has been deprecated in favour of 
standard

DEPENDENCIES

ISOweek import changed to aweek

Documentation

Vignettes have been updated with examples.
</dc:description>
  <dc:identifier>https://zenodo.org/record/2593716</dc:identifier>
  <dc:identifier>10.5281/zenodo.2593716</dc:identifier>
  <dc:identifier>oai:zenodo.org:2593716</dc:identifier>
  <dc:relation>url:https://github.com/reconhub/incidence/tree/1.7.0</dc:relation>
  <dc:relation>doi:10.5281/zenodo.1404718</dc:relation>
  <dc:rights>info:eu-repo/semantics/openAccess</dc:rights>
  <dc:title>reconhub/incidence: Incidence version 1.7.0</dc:title>
  <dc:type>info:eu-repo/semantics/other</dc:type>
  <dc:type>software</dc:type>
</oai_dc:dc>
66
46
views
downloads
All versions This version
Views 667
Downloads 462
Data volume 238.3 MB11.1 MB
Unique views 477
Unique downloads 201

Share

Cite as