mirror of
https://github.com/msberends/AMR.git
synced 2025-07-23 20:23:17 +02:00
(v1.7.1.9022) rely on vctrs for ab selectors
This commit is contained in:
@ -55,6 +55,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 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>
|
||||
@ -66,9 +68,15 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</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">
|
||||
@ -82,7 +90,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.9009</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9022</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -242,7 +250,7 @@
|
||||
<p>Determine which isolates are multidrug-resistant organisms (MDRO) according to international, national and custom guidelines.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>mdro</span><span class='op'>(</span>
|
||||
<div class="ref-usage sourceCode"><pre class='sourceCode r'><code><span class='fu'>mdro</span><span class='op'>(</span>
|
||||
x <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
guideline <span class='op'>=</span> <span class='st'>"CMI2012"</span>,
|
||||
col_mo <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
@ -264,7 +272,7 @@
|
||||
|
||||
<span class='fu'>mdr_cmi2012</span><span class='op'>(</span>x <span class='op'>=</span> <span class='cn'>NULL</span>, only_rsi_columns <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>eucast_exceptional_phenotypes</span><span class='op'>(</span>x <span class='op'>=</span> <span class='cn'>NULL</span>, only_rsi_columns <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></pre>
|
||||
<span class='fu'>eucast_exceptional_phenotypes</span><span class='op'>(</span>x <span class='op'>=</span> <span class='cn'>NULL</span>, only_rsi_columns <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></code></pre></div>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@ -360,34 +368,34 @@ Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <cod
|
||||
|
||||
|
||||
<p>Custom guidelines can be set with the <code>custom_mdro_guideline()</code> function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.</p>
|
||||
<p>If you are familiar with the <code><a href='https://dplyr.tidyverse.org/reference/case_when.html'>case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule is written <em>before</em> the tilde (<code><a href='https://rdrr.io/r/base/tilde.html'>~</a></code>) and the consequence of the rule is written <em>after</em> the tilde:</p><pre><span class='va'>custom</span> <span class='op'><-</span> <span class='fu'>custom_mdro_guideline</span><span class='op'>(</span><span class='va'>CIP</span> <span class='op'>==</span> <span class='st'>"R"</span> <span class='op'>&</span> <span class='va'>age</span> <span class='op'>></span> <span class='fl'>60</span> <span class='op'>~</span> <span class='st'>"Elderly Type A"</span>,
|
||||
<p>If you are familiar with the <code><a href='https://dplyr.tidyverse.org/reference/case_when.html'>case_when()</a></code> function of the <code>dplyr</code> package, you will recognise the input method to set your own rules. Rules must be set using what <span style="R">R</span> considers to be the 'formula notation'. The rule is written <em>before</em> the tilde (<code><a href='https://rdrr.io/r/base/tilde.html'>~</a></code>) and the consequence of the rule is written <em>after</em> the tilde:</p><pre class='sourceCode r'><code><span class='va'>custom</span> <span class='op'><-</span> <span class='fu'>custom_mdro_guideline</span><span class='op'>(</span><span class='va'>CIP</span> <span class='op'>==</span> <span class='st'>"R"</span> <span class='op'>&</span> <span class='va'>age</span> <span class='op'>></span> <span class='fl'>60</span> <span class='op'>~</span> <span class='st'>"Elderly Type A"</span>,
|
||||
<span class='va'>ERY</span> <span class='op'>==</span> <span class='st'>"R"</span> <span class='op'>&</span> <span class='va'>age</span> <span class='op'>></span> <span class='fl'>60</span> <span class='op'>~</span> <span class='st'>"Elderly Type B"</span><span class='op'>)</span>
|
||||
</pre>
|
||||
</code></pre>
|
||||
|
||||
<p>If a row/an isolate matches the first rule, the value after the first <code><a href='https://rdrr.io/r/base/tilde.html'>~</a></code> (in this case <em>'Elderly Type A'</em>) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.</p>
|
||||
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p><pre><span class='va'>custom</span>
|
||||
<p>You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.</p><pre class='sourceCode r'><code><span class='va'>custom</span>
|
||||
<span class='co'>#> A set of custom MDRO rules:</span>
|
||||
<span class='co'>#> 1. CIP is "R" and age is higher than 60 -> Elderly Type A</span>
|
||||
<span class='co'>#> 2. ERY is "R" and age is higher than 60 -> Elderly Type B</span>
|
||||
<span class='co'>#> 3. Otherwise -> Negative</span>
|
||||
<span class='co'>#> </span>
|
||||
<span class='co'>#> Unmatched rows will return NA.</span>
|
||||
</pre>
|
||||
</code></pre>
|
||||
|
||||
<p>The outcome of the function can be used for the <code>guideline</code> argument in the <code>mdro()</code> function:</p><pre><span class='va'>x</span> <span class='op'><-</span> <span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>,
|
||||
<p>The outcome of the function can be used for the <code>guideline</code> argument in the <code>mdro()</code> function:</p><pre class='sourceCode r'><code><span class='va'>x</span> <span class='op'><-</span> <span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>,
|
||||
guideline <span class='op'>=</span> <span class='va'>custom</span><span class='op'>)</span>
|
||||
<span class='fu'><a href='https://rdrr.io/r/base/table.html'>table</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>
|
||||
<span class='co'>#> Negative Elderly Type A Elderly Type B</span>
|
||||
<span class='co'>#> 1070 198 732</span>
|
||||
</pre>
|
||||
</code></pre>
|
||||
|
||||
<p>Rules can also be combined with other custom rules by using <code><a href='https://rdrr.io/r/base/c.html'>c()</a></code>:</p><pre><span class='va'>x</span> <span class='op'><-</span> <span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>,
|
||||
<p>Rules can also be combined with other custom rules by using <code><a href='https://rdrr.io/r/base/c.html'>c()</a></code>:</p><pre class='sourceCode r'><code><span class='va'>x</span> <span class='op'><-</span> <span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>,
|
||||
guideline <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='va'>custom</span>,
|
||||
<span class='fu'>custom_mdro_guideline</span><span class='op'>(</span><span class='va'>ERY</span> <span class='op'>==</span> <span class='st'>"R"</span> <span class='op'>&</span> <span class='va'>age</span> <span class='op'>></span> <span class='fl'>50</span> <span class='op'>~</span> <span class='st'>"Elderly Type C"</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>
|
||||
<span class='fu'><a href='https://rdrr.io/r/base/table.html'>table</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>
|
||||
<span class='co'>#> Negative Elderly Type A Elderly Type B Elderly Type C </span>
|
||||
<span class='co'>#> 961 198 732 109</span>
|
||||
</pre>
|
||||
</code></pre>
|
||||
|
||||
<p>The rules set (the <code>custom</code> object in this case) could be exported to a shared file location using <code><a href='https://rdrr.io/r/base/readRDS.html'>saveRDS()</a></code> if you collaborate with multiple users. The custom rules set could then be imported using <code><a href='https://rdrr.io/r/base/readRDS.html'>readRDS()</a></code>.</p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable Lifecycle</h2>
|
||||
@ -425,7 +433,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
|
||||
<p>On our website <a href='https://msberends.github.io/AMR/'>https://msberends.github.io/AMR/</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR data analysis, the <a href='https://msberends.github.io/AMR/reference/'>complete documentation of all functions</a> and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>, guideline <span class='op'>=</span> <span class='st'>"EUCAST"</span><span class='op'>)</span>
|
||||
<div class="ref-examples sourceCode"><pre class='sourceCode r'><code><span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>, guideline <span class='op'>=</span> <span class='st'>"EUCAST"</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>mdro</span><span class='op'>(</span><span class='va'>example_isolates</span>,
|
||||
guideline <span class='op'>=</span> <span class='fu'>custom_mdro_guideline</span><span class='op'>(</span><span class='va'>AMX</span> <span class='op'>==</span> <span class='st'>"R"</span> <span class='op'>~</span> <span class='st'>"Custom MDRO 1"</span>,
|
||||
@ -445,7 +453,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
|
||||
MRGN <span class='op'>=</span> <span class='fu'>mrgn</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>
|
||||
<span class='op'>}</span>
|
||||
<span class='co'># }</span>
|
||||
</pre>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
|
||||
<nav id="toc" data-toggle="toc" class="sticky-top">
|
||||
@ -457,11 +465,11 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alexander W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>, <a href='https://www.rug.nl/staff/c.j.albers/'>Casper J. Albers</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>.</p>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
|
||||
<p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 1.6.1.9001.</p></p>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
@ -470,6 +478,8 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Reference in New Issue
Block a user