There is a newer version of this record available.

Software Open Access

reconhub/incidence: Incidence version 1.6.0

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


JSON-LD (schema.org) Export

{
  "description": "<p>The changes in this version are small, but the impact changes the behavior, so the minor version number is bumped. This updates <code>first_date</code> to NOT override <code>standard = TRUE</code>. This changes behavior because <code>first_date</code> used to automatically set <code>standard = FALSE</code>.</p>\n<p>The change to having <code>standard</code> supersede <code>first_date</code> is more consistent with normal behavior and gives users more freedom in the end. Much thanks goes to @caijun for pointing this out and elaborating patiently.</p>\n<p>To alert users to the change while minimizing annoyance, a one-time warning is now issued if <code>standard</code> is not specified with <code>first_date</code>. This can be explicitly turned off by setting an the <code>incidence.warn.first_date</code> option to <code>FALSE</code> (as described in the warning):</p>\n<pre><code class=\"lang-r\">library(&quot;incidence&quot;)\nd &lt;- Sys.Date() + sample(-3:10, 10, replace = TRUE)\nSys.Date() - 10\n#&gt; [1] &quot;2019-02-23&quot;\n</code></pre>\n<p>If both <code>standard</code> and <code>first_date</code>specified, no warning</p>\n<pre><code class=\"lang-r\">incidence(d, interval = &quot;week&quot;, first_date = Sys.Date() - 10, standard = TRUE)\n#&gt; &lt;incidence object&gt;\n#&gt; [10 cases from days 2019-02-18 to 2019-03-11]\n#&gt; [10 cases from ISO weeks 2019-W08 to 2019-W11]\n#&gt; \n#&gt; $counts: matrix with 4 rows and 1 columns\n#&gt; $n: 10 cases in total\n#&gt; $dates: 4 dates marking the left-side of bins\n#&gt; $interval: 1 week\n#&gt; $timespan: 22 days\n#&gt; $cumulative: FALSE\n</code></pre>\n<p>warning issued if <code>standard</code> not specified</p>\n<pre><code class=\"lang-r\">incidence(d, interval = &quot;week&quot;, first_date = Sys.Date() - 10)\n#&gt; Warning in incidence.Date(d, interval = &quot;week&quot;, first_date = Sys.Date() - : \n#&gt; \n#&gt; As of incidence version 1.6.0, the default behavior has been modified so that `first_date` no longer overrides `standard`. If you want to use Sys.Date() - 10 as the precise `first_date`, set `standard = FALSE`.\n#&gt; \n#&gt; To remove this warning in the future,  explicitly set the `standard` argument OR use `options(incidence.warn.first_date = FALSE)`\n#&gt; &lt;incidence object&gt;\n#&gt; [10 cases from days 2019-02-18 to 2019-03-11]\n#&gt; [10 cases from ISO weeks 2019-W08 to 2019-W11]\n#&gt; \n#&gt; $counts: matrix with 4 rows and 1 columns\n#&gt; $n: 10 cases in total\n#&gt; $dates: 4 dates marking the left-side of bins\n#&gt; $interval: 1 week\n#&gt; $timespan: 22 days\n#&gt; $cumulative: FALSE\n</code></pre>\n<p>no warning issued the second time around.</p>\n<pre><code class=\"lang-r\">incidence(d, interval = &quot;week&quot;, first_date = Sys.Date() - 10)\n#&gt; &lt;incidence object&gt;\n#&gt; [10 cases from days 2019-02-18 to 2019-03-11]\n#&gt; [10 cases from ISO weeks 2019-W08 to 2019-W11]\n#&gt; \n#&gt; $counts: matrix with 4 rows and 1 columns\n#&gt; $n: 10 cases in total\n#&gt; $dates: 4 dates marking the left-side of bins\n#&gt; $interval: 1 week\n#&gt; $timespan: 22 days\n#&gt; $cumulative: FALSE\n</code></pre>\n<p>&lt;sup&gt;Created on 2019-03-05 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)&lt;/sup&gt;</p>\n<p>Full changes detailed below:</p>\n\nBEHAVIORAL CHANGE\n<ul>\n<li><code>incidence()</code> will no longer allow a non-standard <code>first_date</code> to override\n<code>standard = TRUE</code>. The first call to <code>incidence()</code> specifying <code>first_date</code> \nwithout <code>standard</code> will issue a warning. To use non-standard first dates, \nspecify <code>standard = FALSE</code>. To remove the warning, use\n<code>options(incidence.warn.first_date = FALSE)</code>. See\n<a href=\"https://github.com/reconhub/incidence/issues/87\">https://github.com/reconhub/incidence/issues/87</a> for details.  </li>\n</ul>\nMISC\n<ul>\n<li><code>citation(\"incidence\")</code> will now give the proper citation for our article in\nF1000 research and the global DOI for archived code. See\n<a href=\"https://github.com/reconhub/incidence/pulls/106\">https://github.com/reconhub/incidence/pulls/106</a></li>\n<li>Tests have been updated to avoid randomisation errors on R 3.6.0\nSee <a href=\"https://github.com/reconhub/incidence/issues/107\">https://github.com/reconhub/incidence/issues/107</a></li>\n</ul>", 
  "license": "", 
  "creator": [
    {
      "affiliation": "Imperial College London", 
      "@type": "Person", 
      "name": "Thibaut Jombart"
    }, 
    {
      "affiliation": "Imperial College London", 
      "@type": "Person", 
      "name": "Zhian N. Kamvar"
    }, 
    {
      "affiliation": "Tsinghua University", 
      "@type": "Person", 
      "name": "Jun Cai"
    }, 
    {
      "affiliation": "Stellenbosch University", 
      "@type": "Person", 
      "name": "Juliet Pulliam"
    }, 
    {
      "affiliation": "Public Health England", 
      "@type": "Person", 
      "name": "Sarah Chisholm"
    }, 
    {
      "affiliation": "", 
      "@type": "Person", 
      "name": "Rich FitzJohn"
    }, 
    {
      "affiliation": "", 
      "@type": "Person", 
      "name": "Jakob Schumacher"
    }, 
    {
      "affiliation": "Imperial College London", 
      "@type": "Person", 
      "name": "Sangeeta Bhatia"
    }
  ], 
  "url": "https://zenodo.org/record/2584018", 
  "codeRepository": "https://github.com/reconhub/incidence/tree/1.6.0", 
  "datePublished": "2019-03-05", 
  "version": "1.6.0", 
  "@context": "https://schema.org/", 
  "identifier": "https://doi.org/10.5281/zenodo.2584018", 
  "@id": "https://doi.org/10.5281/zenodo.2584018", 
  "@type": "SoftwareSourceCode", 
  "name": "reconhub/incidence: Incidence version 1.6.0"
}
68
46
views
downloads
All versions This version
Views 688
Downloads 465
Data volume 238.3 MB25.2 MB
Unique views 498
Unique downloads 203

Share

Cite as