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

MARC21 XML Export

<?xml version='1.0' encoding='UTF-8'?>
<record xmlns="">
  <controlfield tag="005">20190315013301.0</controlfield>
  <controlfield tag="001">2593716</controlfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">Zhian N. Kamvar</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Tsinghua University</subfield>
    <subfield code="a">Jun Cai</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Stellenbosch University</subfield>
    <subfield code="a">Juliet Pulliam</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Public Health England</subfield>
    <subfield code="a">Sarah Chisholm</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="a">Rich FitzJohn</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="a">Jakob Schumacher</subfield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">Sangeeta Bhatia</subfield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">5525679</subfield>
    <subfield code="z">md5:9a25688c650c72848663f898dbcd6944</subfield>
    <subfield code="u"></subfield>
  <datafield tag="542" ind1=" " ind2=" ">
    <subfield code="l">open</subfield>
  <datafield tag="260" ind1=" " ind2=" ">
    <subfield code="c">2019-03-14</subfield>
  <datafield tag="909" ind1="C" ind2="O">
    <subfield code="p">software</subfield>
    <subfield code="o"></subfield>
  <datafield tag="100" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">Thibaut Jombart</subfield>
  <datafield tag="245" ind1=" " ind2=" ">
    <subfield code="a">reconhub/incidence: Incidence version 1.7.0</subfield>
  <datafield tag="540" ind1=" " ind2=" ">
    <subfield code="a">Other (Open)</subfield>
  <datafield tag="650" ind1="1" ind2="7">
    <subfield code="a">cc-by</subfield>
    <subfield code="2"></subfield>
  <datafield tag="520" ind1=" " ind2=" ">
    <subfield code="a">Incidence can now handle standardised weeks starting on any day thanks to the &lt;a href=""&gt;&lt;code&gt;aweek&lt;/code&gt;&lt;/a&gt; package :tada:
&lt;pre&gt;&lt;code class="lang-r"&gt;library(incidence)
d &amp;lt;- as.Date(&amp;quot;2019-03-11&amp;quot;) + -7:6
setNames(d, weekdays(d))
#&amp;gt;       Monday      Tuesday    Wednesday     Thursday       Friday 
#&amp;gt; &amp;quot;2019-03-04&amp;quot; &amp;quot;2019-03-05&amp;quot; &amp;quot;2019-03-06&amp;quot; &amp;quot;2019-03-07&amp;quot; &amp;quot;2019-03-08&amp;quot; 
#&amp;gt;     Saturday       Sunday       Monday      Tuesday    Wednesday 
#&amp;gt; &amp;quot;2019-03-09&amp;quot; &amp;quot;2019-03-10&amp;quot; &amp;quot;2019-03-11&amp;quot; &amp;quot;2019-03-12&amp;quot; &amp;quot;2019-03-13&amp;quot; 
#&amp;gt;     Thursday       Friday     Saturday       Sunday 
#&amp;gt; &amp;quot;2019-03-14&amp;quot; &amp;quot;2019-03-15&amp;quot; &amp;quot;2019-03-16&amp;quot; &amp;quot;2019-03-17&amp;quot;
imon &amp;lt;- incidence(d, &amp;quot;mon week&amp;quot;) # also ISO week
itue &amp;lt;- incidence(d, &amp;quot;tue week&amp;quot;)
iwed &amp;lt;- incidence(d, &amp;quot;wed week&amp;quot;)
ithu &amp;lt;- incidence(d, &amp;quot;thu week&amp;quot;)
ifri &amp;lt;- incidence(d, &amp;quot;fri week&amp;quot;)
isat &amp;lt;- incidence(d, &amp;quot;sat week&amp;quot;)
isun &amp;lt;- incidence(d, &amp;quot;sun week&amp;quot;) # also MMWR week and EPI week

pmon &amp;lt;- plot(imon, show_cases = TRUE, labels_week = FALSE)
ptue &amp;lt;- plot(itue, show_cases = TRUE, labels_week = FALSE)
pwed &amp;lt;- plot(iwed, show_cases = TRUE, labels_week = FALSE)
pthu &amp;lt;- plot(ithu, show_cases = TRUE, labels_week = FALSE)
pfri &amp;lt;- plot(ifri, show_cases = TRUE, labels_week = FALSE)
psat &amp;lt;- plot(isat, show_cases = TRUE, labels_week = FALSE)
psun &amp;lt;- plot(isun, show_cases = TRUE, labels_week = FALSE)
&lt;pre&gt;&lt;code class="lang-r"&gt;s &amp;lt;- scale_x_date(limits = c(as.Date(&amp;quot;2019-02-26&amp;quot;), max(d) + 7L))
pmon + s,
ptue + s,
pwed + s,
pthu + s,
pfri + s,
psat + s,
psun + s)
multi-weeks/months/years can now be handled
&lt;pre&gt;&lt;code class="lang-r"&gt;library(incidence)
d &amp;lt;- ebola_sim_clean$linelist$date_of_onset
h &amp;lt;- ebola_sim_clean$linelist$hospital
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;1 epiweek&amp;quot;, group = h))
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;2 epiweeks&amp;quot;, group = h))
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;3 epiweeks&amp;quot;, group = h))
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;2 months&amp;quot;, group = h))
&lt;p&gt;&amp;lt;sup&amp;gt;Created on 2019-03-14 by the [reprex package]( (v0.2.1)&amp;lt;/sup&amp;gt;&lt;/p&gt;
Full set of changes
&lt;li&gt;Any interval &lt;code&gt;seq.Date()&lt;/code&gt; can handle (e.g. "5 weeks") can be handled by
&lt;code&gt;incidence()&lt;/code&gt; (see &lt;a href=""&gt;;/a&gt;)&lt;/li&gt;
&lt;li&gt;Weekly intervals can start on any day of the week by allowing things like 
"epiweek", "isoweek", "wednesday week", "2 Saturday weeks", etc.
(see &lt;a href=""&gt;;/a&gt;)&lt;/li&gt;
&lt;li&gt;the item &lt;code&gt;$weeks&lt;/code&gt; is now added to the incidence object, which contains an
"aweek" class&lt;/li&gt;
&lt;li&gt;plotting will now force the first tick to be the starting point of the
incidence curve&lt;/li&gt;
&lt;li&gt;&lt;code&gt;make_breaks()&lt;/code&gt; will automatically calculate breaks from an incidence object
for plotting. &lt;/li&gt;
&lt;li&gt;&lt;code&gt;scale_x_incidence()&lt;/code&gt; will produce a ggplot2 "ScaleContinuous" object to add
to a ggplot.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;plot.incidence()&lt;/code&gt; argument &lt;code&gt;labels_iso&lt;/code&gt; is deprecated in favor of 
&lt;li&gt;Incidence objects will still have &lt;code&gt;$isoweeks&lt;/code&gt; if the weeks are ISO 8601
standard, but users should rely intead on &lt;code&gt;$weeks&lt;/code&gt; instead. The &lt;code&gt;$isoweeks&lt;/code&gt;
element will be removed in a future version of incidence.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;as.incidence()&lt;/code&gt; argument &lt;code&gt;isoweeks&lt;/code&gt; has been deprecated in favour of 
&lt;li&gt;ISOweek import changed to &lt;a href=""&gt;aweek&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Vignettes have been updated with examples.&lt;/li&gt;
  <datafield tag="773" ind1=" " ind2=" ">
    <subfield code="n">url</subfield>
    <subfield code="i">isSupplementTo</subfield>
    <subfield code="a"></subfield>
  <datafield tag="773" ind1=" " ind2=" ">
    <subfield code="n">doi</subfield>
    <subfield code="i">isVersionOf</subfield>
    <subfield code="a">10.5281/zenodo.1404718</subfield>
  <datafield tag="024" ind1=" " ind2=" ">
    <subfield code="a">10.5281/zenodo.2593716</subfield>
    <subfield code="2">doi</subfield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">software</subfield>
All versions This version
Views 667
Downloads 462
Data volume 238.3 MB11.1 MB
Unique views 477
Unique downloads 201


Cite as