mirror of
https://github.com/msberends/AMR.git
synced 2025-07-17 13:53:17 +02:00
(v1.7.1.9022) rely on vctrs for ab selectors
This commit is contained in:
@ -56,6 +56,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>
|
||||
@ -67,9 +69,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">
|
||||
@ -83,7 +91,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>
|
||||
|
||||
@ -244,7 +252,7 @@
|
||||
). To determine patient episodes not necessarily based on microorganisms, use <code><a href='get_episode.html'>is_new_episode()</a></code> that also supports grouping with the <code>dplyr</code> package.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>first_isolate</span><span class='op'>(</span>
|
||||
<div class="ref-usage sourceCode"><pre class='sourceCode r'><code><span class='fu'>first_isolate</span><span class='op'>(</span>
|
||||
x <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
col_date <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
col_patient_id <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
@ -275,7 +283,7 @@
|
||||
episode_days <span class='op'>=</span> <span class='fl'>365</span>,
|
||||
method <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='st'>"phenotype-based"</span>, <span class='st'>"episode-based"</span>, <span class='st'>"patient-based"</span>, <span class='st'>"isolate-based"</span><span class='op'>)</span>,
|
||||
<span class='va'>...</span>
|
||||
<span class='op'>)</span></pre>
|
||||
<span class='op'>)</span></code></pre></div>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@ -377,7 +385,7 @@
|
||||
<p>To conduct epidemiological analyses on antimicrobial resistance data, only so-called first isolates should be included to prevent overestimation and underestimation of antimicrobial resistance. Different methods can be used to do so, see below.</p>
|
||||
<p>These functions are context-aware. This means that the <code>x</code> argument can be left blank if used inside a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> call, see <em>Examples</em>.</p>
|
||||
<p>The <code>first_isolate()</code> function is a wrapper around the <code><a href='get_episode.html'>is_new_episode()</a></code> function, but more efficient for data sets containing microorganism codes or names.</p>
|
||||
<p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Different methods</h3>
|
||||
<p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p><h3 class='hasAnchor' id='different-methods'><a class='anchor' aria-hidden='true' href='#different-methods'></a>Different methods</h3>
|
||||
|
||||
|
||||
<p>According to Hindler <em>et al.</em> (2007, doi: <a href='https://doi.org/10.1086/511864'>10.1086/511864</a>
|
||||
@ -405,23 +413,23 @@
|
||||
</table>
|
||||
|
||||
|
||||
<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Isolate-based</h4>
|
||||
<h4 class='hasAnchor' id='isolate-based'><a class='anchor' aria-hidden='true' href='#isolate-based'></a>Isolate-based</h4>
|
||||
|
||||
|
||||
<p>This method does not require any selection, as all isolates should be included. It does, however, respect all arguments set in the <code>first_isolate()</code> function. For example, the default setting for <code>include_unknown</code> (<code>FALSE</code>) will omit selection of rows without a microbial ID.</p>
|
||||
|
||||
<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Patient-based</h4>
|
||||
<h4 class='hasAnchor' id='patient-based'><a class='anchor' aria-hidden='true' href='#patient-based'></a>Patient-based</h4>
|
||||
|
||||
|
||||
<p>To include every genus-species combination per patient once, set the <code>episode_days</code> to <code>Inf</code>. Although often inappropriate, this method makes sure that no duplicate isolates are selected from the same patient. In a large longitudinal data set, this could mean that isolates are <em>excluded</em> that were found years after the initial isolate.</p>
|
||||
|
||||
<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Episode-based</h4>
|
||||
<h4 class='hasAnchor' id='episode-based'><a class='anchor' aria-hidden='true' href='#episode-based'></a>Episode-based</h4>
|
||||
|
||||
|
||||
<p>To include every genus-species combination per patient episode once, set the <code>episode_days</code> to a sensible number of days. Depending on the type of analysis, this could be 14, 30, 60 or 365. Short episodes are common for analysing specific hospital or ward data, long episodes are common for analysing regional and national data.</p>
|
||||
<p>This is the most common method to correct for duplicate isolates. Patients are categorised into episodes based on their ID and dates (e.g., the date of specimen receipt or laboratory result). While this is a common method, it does not take into account antimicrobial test results. This means that e.g. a methicillin-resistant <em>Staphylococcus aureus</em> (MRSA) isolate cannot be differentiated from a wildtype <em>Staphylococcus aureus</em> isolate.</p>
|
||||
|
||||
<h4 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Phenotype-based</h4>
|
||||
<h4 class='hasAnchor' id='phenotype-based'><a class='anchor' aria-hidden='true' href='#phenotype-based'></a>Phenotype-based</h4>
|
||||
|
||||
|
||||
<p>This is a more reliable method, since it also <em>weighs</em> the antibiogram (antimicrobial test results) yielding so-called 'first weighted isolates'. There are two different methods to weigh the antibiogram:</p><ol>
|
||||
@ -454,7 +462,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
<div class='dont-index'><p><code><a href='key_antimicrobials.html'>key_antimicrobials()</a></code></p></div>
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># `example_isolates` is a data set available in the AMR package.</span>
|
||||
<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>
|
||||
<span class='co'># See ?example_isolates.</span>
|
||||
|
||||
<span class='va'>example_isolates</span><span class='op'>[</span><span class='fu'>first_isolate</span><span class='op'>(</span><span class='op'>)</span>, <span class='op'>]</span>
|
||||
@ -494,7 +502,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
<span class='co'># when you (erroneously) would have used all isolates for analysis.</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">
|
||||
@ -506,11 +514,11 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
|
||||
<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>
|
||||
@ -519,6 +527,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Reference in New Issue
Block a user