1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-17 20:33:18 +02:00

(v1.7.1.9056) unit tests

This commit is contained in:
2021-11-29 11:55:18 +01:00
parent c8698347cb
commit 5375f75829
21 changed files with 42 additions and 74 deletions

View File

@ -58,8 +58,6 @@
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
@ -71,15 +69,9 @@
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
@ -93,7 +85,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9030</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9056</span>
</span>
</div>
@ -238,7 +230,7 @@
<div class="col-md-9 contents">
<div class="page-header">
<h1>Determine (New) Episodes for Patients</h1>
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/main/R/episode.R'><code>R/episode.R</code></a></small>
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/episode.R'><code>R/episode.R</code></a></small>
<div class="hidden name"><code>get_episode.Rd</code></div>
</div>
@ -246,16 +238,16 @@
<p>These functions determine which items in a vector can be considered (the start of) a new episode, based on the argument <code>episode_days</code>. This can be used to determine clinical episodes for any epidemiological analysis. The <code>get_episode()</code> function returns the index number of the episode per group, while the <code>is_new_episode()</code> function returns values <code>TRUE</code>/<code>FALSE</code> to indicate whether an item in a vector is the start of a new episode.</p>
</div>
<div class="ref-usage sourceCode"><pre class='sourceCode r'><code><span class='fu'>get_episode</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>episode_days</span>, <span class='va'>...</span><span class='op'>)</span>
<pre class="usage"><span class='fu'>get_episode</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>episode_days</span>, <span class='va'>...</span><span class='op'>)</span>
<span class='fu'>is_new_episode</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>episode_days</span>, <span class='va'>...</span><span class='op'>)</span></code></pre></div>
<span class='fu'>is_new_episode</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>episode_days</span>, <span class='va'>...</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>vector of dates (class <code>Date</code> or <code>POSIXt</code>)</p></td>
<td><p>vector of dates (class <code>Date</code> or <code>POSIXt</code>), will be sorted internally to determine episodes</p></td>
</tr>
<tr>
<th>episode_days</th>
@ -297,7 +289,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<div class='dont-index'><p><code><a href='first_isolate.html'>first_isolate()</a></code></p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<div class="ref-examples sourceCode"><pre class='sourceCode r'><code><span class='co'># `example_isolates` is a data set available in the AMR package.</span>
<pre class="examples"><span class='co'># `example_isolates` is a data set available in the AMR package.</span>
<span class='co'># See ?example_isolates.</span>
<span class='fu'>get_episode</span><span class='op'>(</span><span class='va'>example_isolates</span><span class='op'>$</span><span class='va'>date</span>, episode_days <span class='op'>=</span> <span class='fl'>60</span><span class='op'>)</span> <span class='co'># indices</span>
@ -357,7 +349,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span><span class='op'>(</span>flag_episode <span class='op'>=</span> <span class='fu'>is_new_episode</span><span class='op'>(</span><span class='va'>date</span>, <span class='fl'>365</span><span class='op'>)</span><span class='op'>)</span>
<span class='op'>}</span>
<span class='co'># }</span>
</code></pre></div>
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
@ -369,11 +361,11 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<footer>
<div class="copyright">
<p><p>Developed by <a href="https://www.rug.nl/staff/m.s.berends/" class="external-link">Matthijs S. Berends</a>, <a href="https://www.rug.nl/staff/c.f.luz/" class="external-link">Christian F. Luz</a>, <a href="https://www.rug.nl/staff/a.w.friedrich/" class="external-link">Alexander W. Friedrich</a>, <a href="https://www.rug.nl/staff/b.sinha/" class="external-link">Bhanu N. M. Sinha</a>, <a href="https://www.rug.nl/staff/c.j.albers/" class="external-link">Casper J. Albers</a>, <a href="https://www.rug.nl/staff/c.glasner/" class="external-link">Corinna Glasner</a>.</p></p>
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.</p>
</div>
<div class="pkgdown">
<p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 1.6.1.9001.</p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
@ -382,8 +374,6 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
</body>
</html>