1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 10:31:53 +02:00

is.rsi.eligible update

This commit is contained in:
2019-02-04 12:24:07 +01:00
parent cd07d65734
commit 587e00b7be
25 changed files with 1115 additions and 491 deletions

View File

@ -238,7 +238,7 @@
<span class='fu'>is.rsi</span>(<span class='no'>x</span>)
<span class='fu'>is.rsi.eligible</span>(<span class='no'>x</span>)</pre>
<span class='fu'>is.rsi.eligible</span>(<span class='no'>x</span>, <span class='kw'>threshold</span> <span class='kw'>=</span> <span class='fl'>0.05</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
@ -247,6 +247,10 @@
<th>x</th>
<td><p>vector</p></td>
</tr>
<tr>
<th>threshold</th>
<td><p>maximum fraction of <code>x</code> that is allowed to fail transformation, see Examples</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
@ -286,10 +290,15 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<span class='no'>septic_patients</span> <span class='kw'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise_all.html'>mutate_at</a></span>(<span class='fu'><a href='https://dplyr.tidyverse.org/reference/vars.html'>vars</a></span>(<span class='no'>peni</span>:<span class='no'>rifa</span>), <span class='no'>as.rsi</span>)
<span class='co'># fastest way to transform all columns with already valid AB results to class `rsi`:</span>
<span class='no'>septic_patients</span> <span class='kw'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise_all.html'>mutate_if</a></span>(<span class='no'>is.rsi.eligible</span>,
<span class='no'>as.rsi</span>)
<span class='co'># default threshold of `is.rsi.eligible` is 5%.</span>
<span class='fu'>is.rsi.eligible</span>(<span class='no'>WHONET</span>$<span class='no'>`First name`</span>) <span class='co'># fails, &gt;80% is invalid</span>
<span class='fu'>is.rsi.eligible</span>(<span class='no'>WHONET</span>$<span class='no'>`First name`</span>, <span class='kw'>threhold</span> <span class='kw'>=</span> <span class='fl'>0.9</span>) <span class='co'># succeeds</span>
<span class='co'># }</span></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">