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


DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
  <identifier identifierType="DOI">10.5281/zenodo.2593716</identifier>
  <creators>
    <creator>
      <creatorName>Thibaut Jombart</creatorName>
      <affiliation>Imperial College London</affiliation>
    </creator>
    <creator>
      <creatorName>Zhian N. Kamvar</creatorName>
      <affiliation>Imperial College London</affiliation>
    </creator>
    <creator>
      <creatorName>Jun Cai</creatorName>
      <affiliation>Tsinghua University</affiliation>
    </creator>
    <creator>
      <creatorName>Juliet Pulliam</creatorName>
      <affiliation>Stellenbosch University</affiliation>
    </creator>
    <creator>
      <creatorName>Sarah Chisholm</creatorName>
      <affiliation>Public Health England</affiliation>
    </creator>
    <creator>
      <creatorName>Rich FitzJohn</creatorName>
      <affiliation></affiliation>
    </creator>
    <creator>
      <creatorName>Jakob Schumacher</creatorName>
      <affiliation></affiliation>
    </creator>
    <creator>
      <creatorName>Sangeeta Bhatia</creatorName>
      <affiliation>Imperial College London</affiliation>
    </creator>
  </creators>
  <titles>
    <title>reconhub/incidence: Incidence version 1.7.0</title>
  </titles>
  <publisher>Zenodo</publisher>
  <publicationYear>2019</publicationYear>
  <dates>
    <date dateType="Issued">2019-03-14</date>
  </dates>
  <resourceType resourceTypeGeneral="Software"/>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/2593716</alternateIdentifier>
  </alternateIdentifiers>
  <relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="URL" relationType="IsSupplementTo">https://github.com/reconhub/incidence/tree/1.7.0</relatedIdentifier>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.1404718</relatedIdentifier>
  </relatedIdentifiers>
  <version>1.7.0</version>
  <rightsList>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
  </rightsList>
  <descriptions>
    <description descriptionType="Abstract">Incidence can now handle standardised weeks starting on any day thanks to the &lt;a href="https://www.repidemicsconsortium.org/aweek"&gt;&lt;code&gt;aweek&lt;/code&gt;&lt;/a&gt; package :tada:
&lt;pre&gt;&lt;code class="lang-r"&gt;library(incidence)
library(ggplot2)
library(cowplot)
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;/code&gt;&lt;/pre&gt;
&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))
plot_grid(
pmon + s,
ptue + s,
pwed + s,
pthu + s,
pfri + s,
psat + s,
psun + s)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
multi-weeks/months/years can now be handled
&lt;pre&gt;&lt;code class="lang-r"&gt;library(incidence)
library(outbreaks)
d &amp;lt;- ebola_sim_clean$linelist$date_of_onset
h &amp;lt;- ebola_sim_clean$linelist$hospital
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;1 epiweek&amp;quot;, group = h))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;2 epiweeks&amp;quot;, group = h))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;3 epiweeks&amp;quot;, group = h))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class="lang-r"&gt;plot(incidence(d, interval = &amp;quot;2 months&amp;quot;, group = h))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;sup&amp;gt;Created on 2019-03-14 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)&amp;lt;/sup&amp;gt;&lt;/p&gt;
Full set of changes
NEW FEATURES
&lt;ul&gt;
&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="https://github.com/reconhub/incidence/issues/67"&gt;https://github.com/reconhub/incidence/issues/67&lt;/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="https://github.com/reconhub/incidence/issues/55#issuecomment-405297526"&gt;https://github.com/reconhub/incidence/issues/55#issuecomment-405297526&lt;/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;/ul&gt;
NEW FUNCTIONS
&lt;ul&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;/ul&gt;
DEPRECATED
&lt;ul&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;code&gt;labels_week&lt;/code&gt;&lt;/li&gt;
&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;code&gt;standard&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
DEPENDENCIES
&lt;ul&gt;
&lt;li&gt;ISOweek import changed to &lt;a href="https://www.repidemicsconsortium.org/aweek"&gt;aweek&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Documentation
&lt;ul&gt;
&lt;li&gt;Vignettes have been updated with examples.&lt;/li&gt;
&lt;/ul&gt;</description>
  </descriptions>
</resource>
70
46
views
downloads
All versions This version
Views 7010
Downloads 462
Data volume 238.3 MB11.1 MB
Unique views 5110
Unique downloads 201

Share

Cite as