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


Citation Style Language JSON Export

{
  "publisher": "Zenodo", 
  "DOI": "10.5281/zenodo.2593716", 
  "title": "reconhub/incidence: Incidence version 1.7.0", 
  "issued": {
    "date-parts": [
      [
        2019, 
        3, 
        14
      ]
    ]
  }, 
  "abstract": "Incidence can now handle standardised weeks starting on any day thanks to the <a href=\"https://www.repidemicsconsortium.org/aweek\"><code>aweek</code></a> package :tada:\n<pre><code class=\"lang-r\">library(incidence)\nlibrary(ggplot2)\nlibrary(cowplot)\nd &lt;- as.Date(&quot;2019-03-11&quot;) + -7:6\nsetNames(d, weekdays(d))\n#&gt;       Monday      Tuesday    Wednesday     Thursday       Friday \n#&gt; &quot;2019-03-04&quot; &quot;2019-03-05&quot; &quot;2019-03-06&quot; &quot;2019-03-07&quot; &quot;2019-03-08&quot; \n#&gt;     Saturday       Sunday       Monday      Tuesday    Wednesday \n#&gt; &quot;2019-03-09&quot; &quot;2019-03-10&quot; &quot;2019-03-11&quot; &quot;2019-03-12&quot; &quot;2019-03-13&quot; \n#&gt;     Thursday       Friday     Saturday       Sunday \n#&gt; &quot;2019-03-14&quot; &quot;2019-03-15&quot; &quot;2019-03-16&quot; &quot;2019-03-17&quot;\nimon &lt;- incidence(d, &quot;mon week&quot;) # also ISO week\nitue &lt;- incidence(d, &quot;tue week&quot;)\niwed &lt;- incidence(d, &quot;wed week&quot;)\nithu &lt;- incidence(d, &quot;thu week&quot;)\nifri &lt;- incidence(d, &quot;fri week&quot;)\nisat &lt;- incidence(d, &quot;sat week&quot;)\nisun &lt;- incidence(d, &quot;sun week&quot;) # also MMWR week and EPI week\n\npmon &lt;- plot(imon, show_cases = TRUE, labels_week = FALSE)\nptue &lt;- plot(itue, show_cases = TRUE, labels_week = FALSE)\npwed &lt;- plot(iwed, show_cases = TRUE, labels_week = FALSE)\npthu &lt;- plot(ithu, show_cases = TRUE, labels_week = FALSE)\npfri &lt;- plot(ifri, show_cases = TRUE, labels_week = FALSE)\npsat &lt;- plot(isat, show_cases = TRUE, labels_week = FALSE)\npsun &lt;- plot(isun, show_cases = TRUE, labels_week = FALSE)\n</code></pre>\n<pre><code class=\"lang-r\">s &lt;- scale_x_date(limits = c(as.Date(&quot;2019-02-26&quot;), max(d) + 7L))\nplot_grid(\npmon + s,\nptue + s,\npwed + s,\npthu + s,\npfri + s,\npsat + s,\npsun + s)\n</code></pre>\n<p></p>\nmulti-weeks/months/years can now be handled\n<pre><code class=\"lang-r\">library(incidence)\nlibrary(outbreaks)\nd &lt;- ebola_sim_clean$linelist$date_of_onset\nh &lt;- ebola_sim_clean$linelist$hospital\n</code></pre>\n<pre><code class=\"lang-r\">plot(incidence(d, interval = &quot;1 epiweek&quot;, group = h))\n</code></pre>\n<p></p>\n<pre><code class=\"lang-r\">plot(incidence(d, interval = &quot;2 epiweeks&quot;, group = h))\n</code></pre>\n<p></p>\n<pre><code class=\"lang-r\">plot(incidence(d, interval = &quot;3 epiweeks&quot;, group = h))\n</code></pre>\n<p></p>\n<pre><code class=\"lang-r\">plot(incidence(d, interval = &quot;2 months&quot;, group = h))\n</code></pre>\n<p></p>\n<p>&lt;sup&gt;Created on 2019-03-14 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)&lt;/sup&gt;</p>\nFull set of changes\nNEW FEATURES\n<ul>\n<li>Any interval <code>seq.Date()</code> can handle (e.g. \"5 weeks\") can be handled by\n<code>incidence()</code> (see <a href=\"https://github.com/reconhub/incidence/issues/67\">https://github.com/reconhub/incidence/issues/67</a>)</li>\n<li>Weekly intervals can start on any day of the week by allowing things like \n\"epiweek\", \"isoweek\", \"wednesday week\", \"2 Saturday weeks\", etc.\n(see <a href=\"https://github.com/reconhub/incidence/issues/55#issuecomment-405297526\">https://github.com/reconhub/incidence/issues/55#issuecomment-405297526</a>)</li>\n<li>the item <code>$weeks</code> is now added to the incidence object, which contains an\n\"aweek\" class</li>\n<li>plotting will now force the first tick to be the starting point of the\nincidence curve</li>\n</ul>\nNEW FUNCTIONS\n<ul>\n<li><code>make_breaks()</code> will automatically calculate breaks from an incidence object\nfor plotting. </li>\n<li><code>scale_x_incidence()</code> will produce a ggplot2 \"ScaleContinuous\" object to add\nto a ggplot.</li>\n</ul>\nDEPRECATED\n<ul>\n<li><code>plot.incidence()</code> argument <code>labels_iso</code> is deprecated in favor of \n<code>labels_week</code></li>\n<li>Incidence objects will still have <code>$isoweeks</code> if the weeks are ISO 8601\nstandard, but users should rely intead on <code>$weeks</code> instead. The <code>$isoweeks</code>\nelement will be removed in a future version of incidence.</li>\n<li><code>as.incidence()</code> argument <code>isoweeks</code> has been deprecated in favour of \n<code>standard</code></li>\n</ul>\nDEPENDENCIES\n<ul>\n<li>ISOweek import changed to <a href=\"https://www.repidemicsconsortium.org/aweek\">aweek</a></li>\n</ul>\nDocumentation\n<ul>\n<li>Vignettes have been updated with examples.</li>\n</ul>", 
  "author": [
    {
      "family": "Thibaut Jombart"
    }, 
    {
      "family": "Zhian N. Kamvar"
    }, 
    {
      "family": "Jun Cai"
    }, 
    {
      "family": "Juliet Pulliam"
    }, 
    {
      "family": "Sarah Chisholm"
    }, 
    {
      "family": "Rich FitzJohn"
    }, 
    {
      "family": "Jakob Schumacher"
    }, 
    {
      "family": "Sangeeta Bhatia"
    }
  ], 
  "version": "1.7.0", 
  "type": "article", 
  "id": "2593716"
}
75
47
views
downloads
All versions This version
Views 7512
Downloads 472
Data volume 245.6 MB11.1 MB
Unique views 5512
Unique downloads 211

Share

Cite as