1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 09:51:48 +02:00

(v1.3.0.9022) mo_matching_score(), poorman update, as.rsi() fix

This commit is contained in:
2020-09-18 16:05:53 +02:00
parent 89401ede9f
commit 4e40e42011
138 changed files with 2923 additions and 1472 deletions

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with 500 isolates - WHONET example — WHONET" />
<meta property="og:description" content="This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are from our example_isolates data set. All patient names are created using online surname generators and are only in place for practice purposes." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 500 observations and 53 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 500 observations and 53 variables:</p><ul>
<li><p><code>Identification number</code><br /> ID of the sample</p></li>
<li><p><code>Specimen number</code><br /> ID of the specimen</p></li>
<li><p><code>Organism</code><br /> Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using <code><a href='as.mo.html'>as.mo()</a></code>.</p></li>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Retrieve antimicrobial drug names and doses from clinical text — ab_from_text" />
<meta property="og:description" content="Use this function on e.g. clinical texts from health care records. It returns a list with all antimicrobial drugs, doses and forms of administration found in the texts." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -282,7 +282,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A <a href='https://rdrr.io/r/base/list.html'>list</a>, or a <a href='https://rdrr.io/r/base/character.html'>character</a> if <code>collapse</code> is not <code>NULL</code></p>
<p>A <a href='https://rdrr.io/r/base/list.html'>list</a>, or a <a href='https://rdrr.io/r/base/character.html'>character</a> if <code>collapse</code> is not <code>NULL</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>This function is also internally used by <code><a href='as.ab.html'>as.ab()</a></code>, although it then only searches for the first drug name and will throw a note if more drug names could have been returned.</p><h3>Parameter <code>type</code></h3>
@ -345,7 +345,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
type = <span class='st'>"admin"</span>,
collapse = <span class='st'>"|"</span>))
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Get properties of an antibiotic — ab_property" />
<meta property="og:description" content="Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab()." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -309,10 +309,10 @@
<ul>
<li><p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> in case of <code>ab_cid()</code></p></li>
<li><p>A named <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>ab_info()</code> and multiple <code>ab_synonyms()</code>/<code>ab_tradenames()</code></p></li>
<li><p>A <code><a href='https://rdrr.io/r/base/double.html'>double</a></code> in case of <code>ab_ddd()</code></p></li>
<li><p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in all other cases</p></li>
<li><p>An <a href='https://rdrr.io/r/base/integer.html'>integer</a> in case of <code>ab_cid()</code></p></li>
<li><p>A named <a href='https://rdrr.io/r/base/list.html'>list</a> in case of <code>ab_info()</code> and multiple <code>ab_synonyms()</code>/<code>ab_tradenames()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/double.html'>double</a> in case of <code>ab_ddd()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/character.html'>character</a> in all other cases</p></li>
</ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Split ages into age groups — age_groups" />
<meta property="og:description" content="Split ages into age groups defined by the split parameter. This allows for easier demographic (antimicrobial resistance) analysis." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -323,8 +323,9 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='kw'>mo</span> <span class='op'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(age_group = <span class='fu'>age_groups</span>(<span class='kw'>age</span>)) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='kw'>age_group</span>, <span class='kw'>CIP</span>) <span class='op'>%&gt;%</span>
<span class='fu'><a href='ggplot_rsi.html'>ggplot_rsi</a></span>(x = <span class='st'>"age_group"</span>)
}</pre>
<span class='fu'><a href='ggplot_rsi.html'>ggplot_rsi</a></span>(x = <span class='st'>"age_group"</span>, minimum = <span class='fl'>0</span>)
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data sets with 558 antimicrobials — antibiotics" />
<meta property="og:description" content="Two data sets containing all antibiotics/antimycotics and antivirals. Use as.ab() or one of the ab_property() functions to retrieve values from the antibiotics data set. Three identifiers are included in this data set: an antibiotic ID (ab, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc) as defined by the WHO, and a Compound ID (cid) as found in PubChem. Other properties in this data set are derived from one or more of these codes." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -250,7 +250,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<h3>For the antibiotics data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 456 observations and 14 variables:</h3>
<h3>For the antibiotics data set: a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 456 observations and 14 variables:</h3>
<ul>
<li><p><code>ab</code><br /> Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></li>
@ -270,7 +270,7 @@
</ul>
<h3>For the antivirals data set: a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 102 observations and 9 variables:</h3>
<h3>For the antivirals data set: a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 102 observations and 9 variables:</h3>
<ul>
<li><p><code>atc</code><br /> ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC</p></li>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Transform input to an antibiotic ID — as.ab" />
<meta property="og:description" content="Use this function to determine the antibiotic code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and synonyms (brand names)." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -269,7 +269,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Character (vector) with class <code>ab</code>. Unknown values will return <code>NA</code>.</p>
<p>A <a href='https://rdrr.io/r/base/character.html'>character</a> <a href='https://rdrr.io/r/base/vector.html'>vector</a> with additional class <code>ab</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>All entries in the <a href='antibiotics.html'>antibiotics</a> data set have three different identifiers: a human readable EARS-Net code (column <code>ab</code>, used by ECDC and WHONET), an ATC code (column <code>atc</code>, used by WHO), and a CID code (column <code>cid</code>, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.</p>
@ -317,7 +317,7 @@ This package contains <strong>all ~550 antibiotic, antimycotic and antiviral dru
<div class='dont-index'>
<ul>
<li><p><a href='antibiotics.html'>antibiotics</a> for the dataframe that is being used to determine ATCs</p></li>
<li><p><a href='antibiotics.html'>antibiotics</a> for the <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> that is being used to determine ATCs</p></li>
<li><p><code><a href='ab_from_text.html'>ab_from_text()</a></code> for a function to retrieve antimicrobial drugs from clinical text (from health care records)</p></li>
</ul>
</div>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Transform input to disk diffusion diameters — as.disk" />
<meta property="og:description" content="This transforms a vector to a new class disk, which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -261,7 +261,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> with additional new class <code>disk</code></p>
<p>An <a href='https://rdrr.io/r/base/integer.html'>integer</a> with additional class <code>disk</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Interpret disk values as RSI values with <code><a href='as.rsi.html'>as.rsi()</a></code>. It supports guidelines from EUCAST and CLSI.</p>

View File

@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Transform input to minimum inhibitory concentrations — as.mic • AMR (for R)</title>
<title>Transform input to minimum inhibitory concentrations (MIC) — as.mic • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
@ -48,9 +48,9 @@
<link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script>
<meta property="og:title" content="Transform input to minimum inhibitory concentrations — as.mic" />
<meta property="og:title" content="Transform input to minimum inhibitory concentrations (MIC) — as.mic" />
<meta property="og:description" content="This transforms a vector to a new class mic, which is an ordered factor with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as NA with a warning." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -233,13 +233,13 @@
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Transform input to minimum inhibitory concentrations</h1>
<h1>Transform input to minimum inhibitory concentrations (MIC)</h1>
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/mic.R'><code>R/mic.R</code></a></small>
<div class="hidden name"><code>as.mic.Rd</code></div>
</div>
<div class="ref-description">
<p>This transforms a vector to a new class <code>mic</code>, which is an ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p>
<p>This transforms a vector to a new class <code>mic</code>, which is an ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as <code>NA</code> with a warning.</p>
</div>
<pre class="usage"><span class='fu'>as.mic</span>(<span class='kw'>x</span>, na.rm = <span class='fl'>FALSE</span>)
@ -261,7 +261,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with new class <code>mic</code></p>
<p>Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with additional class <code>mic</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>To interpret MIC values as RSI values, use <code><a href='as.rsi.html'>as.rsi()</a></code> on MIC values. It supports guidelines from EUCAST and CLSI.</p>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Transform input to a microorganism ID — as.mo" />
<meta property="og:description" content="Use this function to determine a valid microorganism ID (mo). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like &quot;Staphylococcus aureus&quot;), an abbreviated name (like &quot;S. aureus&quot;), an abbreviation known in the field (like &quot;MRSA&quot;), or just a genus. Please see Examples." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9018</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -266,7 +266,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a character vector or a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with one or two columns</p></td>
<td><p>a character vector or a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with one or two columns</p></td>
</tr>
<tr>
<th>Becker</th>
@ -284,7 +284,7 @@
</tr>
<tr>
<th>reference_df</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> to be used for extra reference when translating <code>x</code> to a valid <code>mo</code>. See <code><a href='mo_source.html'>set_mo_source()</a></code> and <code><a href='mo_source.html'>get_mo_source()</a></code> to automate the usage of your own codes (e.g. used in your analysis or organisation).</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> to be used for extra reference when translating <code>x</code> to a valid <code>mo</code>. See <code><a href='mo_source.html'>set_mo_source()</a></code> and <code><a href='mo_source.html'>get_mo_source()</a></code> to automate the usage of your own codes (e.g. used in your analysis or organisation).</p></td>
</tr>
<tr>
<th>ignore_pattern</th>
@ -302,7 +302,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> <code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code> with additional class <code>mo</code></p>
<p>A <a href='https://rdrr.io/r/base/character.html'>character</a> <a href='https://rdrr.io/r/base/vector.html'>vector</a> with additional class <code>mo</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
@ -352,9 +352,9 @@
</ul>
<p>There are three helper functions that can be run after using the <code>as.mo()</code> function:</p><ul>
<li><p>Use <code>mo_uncertainties()</code> to get a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> that prints in a pretty format with all taxonomic names that were guessed. The output contains a score that is based on the human pathogenic prevalence and the <a href='https://en.wikipedia.org/wiki/Levenshtein_distance'>Levenshtein distance</a> between the user input and the full taxonomic name.</p></li>
<li><p>Use <code>mo_failures()</code> to get a <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> <code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code> with all values that could not be coerced to a valid value.</p></li>
<li><p>Use <code>mo_renamed()</code> to get a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with all values that could be coerced based on old, previously accepted taxonomic names.</p></li>
<li><p>Use <code>mo_uncertainties()</code> to get a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see <em>Background on matching score</em>).</p></li>
<li><p>Use <code>mo_failures()</code> to get a <a href='https://rdrr.io/r/base/character.html'>character</a> <a href='https://rdrr.io/r/base/vector.html'>vector</a> with all values that could not be coerced to a valid value.</p></li>
<li><p>Use <code>mo_renamed()</code> to get a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with all values that could be coerced based on old, previously accepted taxonomic names.</p></li>
</ul>
@ -366,6 +366,21 @@
<p>Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is <em>Aspergillus</em>, <em>Bacteroides</em>, <em>Candida</em>, <em>Capnocytophaga</em>, <em>Chryseobacterium</em>, <em>Cryptococcus</em>, <em>Elisabethkingia</em>, <em>Flavobacterium</em>, <em>Fusobacterium</em>, <em>Giardia</em>, <em>Leptotrichia</em>, <em>Mycoplasma</em>, <em>Prevotella</em>, <em>Rhodotorula</em>, <em>Treponema</em>, <em>Trichophyton</em> or <em>Ureaplasma</em>. This group consequently contains all less common and rare human pathogens.</p>
<p>Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans.</p>
<h3>Background on matching scores</h3>
<p>With ambiguous user input, the returned results are chosen based on their matching score using <code><a href='mo_matching_score.html'>mo_matching_score()</a></code>. This matching score is based on four parameters:</p><ol>
<li><p>The prevalence \(P\) is categorised into group 1, 2 and 3 as stated above;</p></li>
<li><p>A kingdom index \(K\) is set as follows: Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, and all others = 5;</p></li>
<li><p>The level of uncertainty \(U\) needed to get to the result, as stated above (1 to 3);</p></li>
<li><p>The <a href='https://en.wikipedia.org/wiki/Levenshtein_distance'>Levenshtein distance</a> \(L\) is the distance between the user input and all taxonomic full names, with the text length of the user input being the maximum distance. A modified version of the Levenshtein distance \(L'\) based on the text length of the full name \(F\) is calculated as:</p></li>
</ol>
<p>$$L' = F - \frac{0.5 \times L}{F}$$</p>
<p>The final matching score \(M\) is calculated as:
$$M = L' \times \frac{1}{P \times K} * \frac{1}{U}$$</p>
<p>All matches are sorted descending on their matching score and for all user input values, the top match will be returned.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
@ -403,7 +418,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<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 analysis, the <a href='https://msberends.github.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a> for the <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> that is being used to determine ID's.</p>
<div class='dont-index'><p><a href='microorganisms.html'>microorganisms</a> for the <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> that is being used to determine ID's.</p>
<p>The <code><a href='mo_property.html'>mo_property()</a></code> functions (like <code><a href='mo_property.html'>mo_genus()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>) to get properties based on the returned code.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>

View File

@ -49,8 +49,8 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Get ATC properties from WHOCC website — atc_online_property" />
<meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:description" content="Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -239,14 +239,15 @@
</div>
<div class="ref-description">
<p>Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.</p>
<p>Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit.</p>
</div>
<pre class="usage"><span class='fu'>atc_online_property</span>(
<span class='kw'>atc_code</span>,
<span class='kw'>property</span>,
administration = <span class='st'>"O"</span>,
url = <span class='st'>"https://www.whocc.no/atc_ddd_index/?code=%s&amp;showdescription=no"</span>
url = <span class='st'>"https://www.whocc.no/atc_ddd_index/?code=%s&amp;showdescription=no"</span>,
url_vet = <span class='st'>"https://www.whocc.no/atcvet/atcvet_index/?code=%s&amp;showdescription=no"</span>
)
<span class='fu'>atc_online_groups</span>(<span class='kw'>atc_code</span>, <span class='kw'>...</span>)
@ -270,7 +271,11 @@
</tr>
<tr>
<th>url</th>
<td><p>url of website of the WHO. The sign <code>%s</code> can be used as a placeholder for ATC codes.</p></td>
<td><p>url of website of the WHOCC. The sign <code>%s</code> can be used as a placeholder for ATC codes.</p></td>
</tr>
<tr>
<th>url_vet</th>
<td><p>url of website of the WHOCC for veterinary medicine. The sign <code>%s</code> can be used as a placeholder for ATC_vet codes (that all start with "Q").</p></td>
</tr>
<tr>
<th>...</th>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Check availability of columns — availability" />
<meta property="og:description" content="Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. susceptibility() and resistance()." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -249,7 +249,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>tbl</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> or <code><a href='https://rdrr.io/r/base/list.html'>list</a></code></p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> or <a href='https://rdrr.io/r/base/list.html'>list</a></p></td>
</tr>
<tr>
<th>width</th>
@ -259,10 +259,10 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p><code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with column names of <code>tbl</code> as row names</p>
<p><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with column names of <code>tbl</code> as row names</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function returns a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with columns <code>"resistant"</code> and <code>"visual_resistance"</code>. The values in that columns are calculated with <code><a href='proportion.html'>resistance()</a></code>.</p>
<p>The function returns a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with columns <code>"resistant"</code> and <code>"visual_resistance"</code>. The values in that columns are calculated with <code><a href='proportion.html'>resistance()</a></code>.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
@ -291,7 +291,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='kw'>mo</span> <span class='op'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select_all.html'>select_if</a></span>(<span class='kw'>is.rsi</span>) <span class='op'>%&gt;%</span>
<span class='fu'>availability</span>()
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Determine bug-drug combinations — bug_drug_combinations" />
<meta property="og:description" content="Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format() on the result to prettify it to a publicable/printable format, see Examples." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -324,7 +324,7 @@
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>The function <code>bug_drug_combinations()</code> returns a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with columns "mo", "ab", "S", "I", "R" and "total".</p>
<p>The function <code>bug_drug_combinations()</code> returns a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with columns "mo", "ab", "S", "I", "R" and "total".</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code><a href='https://rdrr.io/r/base/format.html'>format()</a></code> calculates the resistance per bug-drug combination. Use <code>combine_IR = FALSE</code> (default) to test R vs. S+I and <code>combine_IR = TRUE</code> to test R+I vs. S.</p>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Version info of included Catalogue of Life — catalogue_of_life_version" />
<meta property="og:description" content="This function returns information about the included data from the Catalogue of Life." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>a <code><a href='https://rdrr.io/r/base/list.html'>list</a></code>, which prints in pretty format</p>
<p>a <a href='https://rdrr.io/r/base/list.html'>list</a>, which prints in pretty format</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>For DSMZ, see <a href='microorganisms.html'>microorganisms</a>.</p>

View File

@ -51,7 +51,7 @@
<meta property="og:title" content="Count available isolates — count" />
<meta property="og:description" content="These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in summarise() from the dplyr package and also support grouped variables, please see Examples.
count_resistant() should be used to count resistant isolates, count_susceptible() should be used to count susceptible isolates." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -283,7 +283,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
</tr>
<tr>
<th>data</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing columns with class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing columns with class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr>
<tr>
<th>translate_ab</th>
@ -305,7 +305,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code></p>
<p>An <a href='https://rdrr.io/r/base/integer.html'>integer</a></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>These functions are meant to count isolates. Use the <code><a href='proportion.html'>resistance()</a></code>/<code><a href='proportion.html'>susceptibility()</a></code> functions to calculate microbial resistance/susceptibility.</p>
@ -356,10 +356,12 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
</pre>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> <span class='fu'>count_S</span>() <span class='op'>+</span> <span class='fu'>count_I</span>() <span class='op'>+</span> <span class='fu'>count_R</span>() <span class='op'>=</span> <span class='fu'>count_all</span>()
<span class='fu'><a href='proportion.html'>proportion_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_R</a></span>() <span class='op'>=</span> <span class='fl'>1</span></pre>
<span class='fu'><a href='proportion.html'>proportion_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_R</a></span>() <span class='op'>=</span> <span class='fl'>1</span>
</pre>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> <span class='fu'>count_S</span>() <span class='op'>+</span> <span class='fu'>count_I</span>() <span class='op'>+</span> <span class='fu'>count_R</span>() <span class='op'>&gt;=</span> <span class='fu'>count_all</span>()
<span class='fu'><a href='proportion.html'>proportion_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_R</a></span>() <span class='op'>&gt;=</span> <span class='fl'>1</span></pre>
<span class='fu'><a href='proportion.html'>proportion_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='proportion.html'>proportion_R</a></span>() <span class='op'>&gt;=</span> <span class='fl'>1</span>
</pre>
<p>Using <code>only_all_tested</code> has no impact when only using one antibiotic as input.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -430,7 +432,8 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='kw'>hospital_id</span>, <span class='kw'>AMX</span>, <span class='kw'>CIP</span>) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='kw'>hospital_id</span>) <span class='op'>%&gt;%</span>
<span class='fu'>count_df</span>(translate = <span class='fl'>FALSE</span>)
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -51,7 +51,7 @@
<meta property="og:title" content="Apply EUCAST rules — eucast_rules" />
<meta property="og:description" content="Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, http://eucast.org), see Source. This includes (1) expert rules and intrinsic resistance and (2) inferred resistance as defined in their breakpoint tables.
To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
</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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -297,7 +297,7 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>The input of <code>x</code>, possibly with edited values of antibiotics. Or, if <code>verbose = TRUE</code>, a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with all original and new values of the affected bug-drug combinations.</p>
<p>The input of <code>x</code>, possibly with edited values of antibiotics. Or, if <code>verbose = TRUE</code>, a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with all original and new values of the affected bug-drug combinations.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi()</a></code> for that. <br />
@ -451,7 +451,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='co'># do not apply EUCAST rules, but rather get a data.frame</span>
<span class='co'># with 18 rows, containing all details about the transformations:</span>
<span class='kw'>c</span> <span class='op'>&lt;-</span> <span class='fu'>eucast_rules</span>(<span class='kw'>a</span>, verbose = <span class='fl'>TRUE</span>)
<span class='co'># }</span></pre>
<span class='co'># }</span>
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with 2,000 example isolates — example_isolates" />
<meta property="og:description" content="A data set containing 2,000 microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read the tutorial on our website." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 2,000 observations and 49 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 2,000 observations and 49 variables:</p><ul>
<li><p><code>date</code><br /> date of receipt at the laboratory</p></li>
<li><p><code>hospital_id</code><br /> ID of the hospital, from A to D</p></li>
<li><p><code>ward_icu</code><br /> logical to determine if ward is an intensive care unit</p></li>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with unclean data — example_isolates_unclean" />
<meta property="og:description" content="A data set containing 3,000 microbial isolates that are not cleaned up and consequently not ready for AMR analysis. This data set can be used for practice." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 3,000 observations and 8 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 3,000 observations and 8 variables:</p><ul>
<li><p><code>patient_id</code><br /> ID of the patient</p></li>
<li><p><code>date</code><br /> date of receipt at the laboratory</p></li>
<li><p><code>hospital</code><br /> ID of the hospital, from A to C</p></li>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Determine first (weighted) isolates — first_isolate" />
<meta property="og:description" content="Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -285,7 +285,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing isolates.</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates.</p></td>
</tr>
<tr>
<th>col_date</th>
@ -369,14 +369,16 @@
<p><strong>WHY THIS IS SO IMPORTANT</strong> <br />
To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode <a href='https://www.ncbi.nlm.nih.gov/pubmed/17304462'>(ref)</a>. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all <em>S. aureus</em> isolates would be overestimated, because you included this MRSA more than once. It would be <a href='https://en.wikipedia.org/wiki/Selection_bias'>selection bias</a>.</p>
<p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p>
<p>The functions <code>filter_first_isolate()</code> and <code>filter_first_weighted_isolate()</code> are helper functions to quickly filter on first isolates. The function <code>filter_first_isolate()</code> is essentially equal to one of:</p><pre> <span class='kw'>x</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'>first_isolate</span>(<span class='kw'>.</span>, <span class='kw'>...</span>))</pre>
<p>The functions <code>filter_first_isolate()</code> and <code>filter_first_weighted_isolate()</code> are helper functions to quickly filter on first isolates. The function <code>filter_first_isolate()</code> is essentially equal to one of:</p><pre> <span class='kw'>x</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'>first_isolate</span>(<span class='kw'>.</span>, <span class='kw'>...</span>))
</pre>
<p>The function <code>filter_first_weighted_isolate()</code> is essentially equal to:</p><pre> <span class='kw'>x</span> <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span>(keyab = <span class='fu'><a href='key_antibiotics.html'>key_antibiotics</a></span>(<span class='kw'>.</span>)) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span>(only_weighted_firsts = <span class='fu'>first_isolate</span>(<span class='kw'>x</span>,
col_keyantibiotics = <span class='st'>"keyab"</span>, <span class='kw'>...</span>)) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='kw'>only_weighted_firsts</span> <span class='op'>==</span> <span class='fl'>TRUE</span>) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='op'>-</span><span class='kw'>only_weighted_firsts</span>, <span class='op'>-</span><span class='kw'>keyab</span>)</pre>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='op'>-</span><span class='kw'>only_weighted_firsts</span>, <span class='op'>-</span><span class='kw'>keyab</span>)
</pre>
<h2 class="hasAnchor" id="key-antibiotics"><a class="anchor" href="#key-antibiotics"></a>Key antibiotics</h2>
@ -452,7 +454,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='kw'>x</span><span class='op'>$</span><span class='kw'>first_isolate_weighed</span> <span class='op'>&lt;-</span> <span class='fu'>first_isolate</span>(<span class='kw'>x</span>, col_keyantibiotics = <span class='st'>'keyab'</span>)
<span class='kw'>x</span><span class='op'>$</span><span class='kw'>first_blood_isolate</span> <span class='op'>&lt;-</span> <span class='fu'>first_isolate</span>(<span class='kw'>x</span>, specimen_group = <span class='st'>"Blood"</span>)
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="AMR plots with ggplot2 — ggplot_rsi" />
<meta property="og:description" content="Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on ggplot2 functions." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -253,6 +253,7 @@
translate_ab = <span class='st'>"name"</span>,
combine_SI = <span class='fl'>TRUE</span>,
combine_IR = <span class='fl'>FALSE</span>,
minimum = <span class='fl'>30</span>,
language = <span class='fu'><a href='translate.html'>get_locale</a></span>(),
nrow = <span class='kw'>NULL</span>,
colours = <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(S = <span class='st'>"#61a8ff"</span>, SI = <span class='st'>"#61a8ff"</span>, I = <span class='st'>"#61f7ff"</span>, IR = <span class='st'>"#ff6961"</span>, R =
@ -273,6 +274,7 @@
x = <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"antibiotic"</span>, <span class='st'>"interpretation"</span>),
fill = <span class='st'>"interpretation"</span>,
translate_ab = <span class='st'>"name"</span>,
minimum = <span class='fl'>30</span>,
language = <span class='fu'><a href='translate.html'>get_locale</a></span>(),
combine_SI = <span class='fl'>TRUE</span>,
combine_IR = <span class='fl'>FALSE</span>,
@ -294,6 +296,8 @@
position = <span class='kw'>NULL</span>,
x = <span class='st'>"antibiotic"</span>,
translate_ab = <span class='st'>"name"</span>,
minimum = <span class='fl'>30</span>,
language = <span class='fu'><a href='translate.html'>get_locale</a></span>(),
combine_SI = <span class='fl'>TRUE</span>,
combine_IR = <span class='fl'>FALSE</span>,
datalabels.size = <span class='fl'>3</span>,
@ -305,7 +309,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>data</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with column(s) of class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with column(s) of class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr>
<tr>
<th>position</th>
@ -343,6 +347,10 @@
<th>combine_IR</th>
<td><p>a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter <code>combine_SI</code>.</p></td>
</tr>
<tr>
<th>minimum</th>
<td><p>the minimum allowed number of available (tested) isolates. Any isolate count lower than <code>minimum</code> will return <code>NA</code> with a warning. The default number of <code>30</code> isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.</p></td>
</tr>
<tr>
<th>language</th>
<td><p>language of the returned text, defaults to system language (see <code><a href='translate.html'>get_locale()</a></code>) and can also be set with <code><a href='https://rdrr.io/r/base/options.html'>getOption("AMR_locale")</a></code>. Use <code>language = NULL</code> or <code>language = ""</code> to prevent translation.</p></td>
@ -492,7 +500,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
title = <span class='st'>"AMR of Anti-UTI Drugs Per Hospital"</span>,
x.title = <span class='st'>"Hospital"</span>,
datalabels = <span class='fl'>FALSE</span>)
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Guess antibiotic column — guess_ab_col" />
<meta property="og:description" content="This tries to find a column name in a data set based on information from the antibiotics data set. Also supports WHONET abbreviations." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -249,7 +249,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code></p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></p></td>
</tr>
<tr>
<th>search_string</th>
@ -306,7 +306,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
<span class='kw'>df</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span>(AMP_ED2 = <span class='st'>"S"</span>,
AMP_ED20 = <span class='st'>"S"</span>)
<span class='fu'>guess_ab_col</span>(<span class='kw'>df</span>, <span class='st'>"ampicillin"</span>)
<span class='co'># [1] "AMP_ED20"</span></pre>
<span class='co'># [1] "AMP_ED20"</span>
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -81,7 +81,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.3.0.9021</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -431,7 +431,7 @@
<td>
<p><code><a href="as.mic.html">as.mic()</a></code> <code><a href="as.mic.html">is.mic()</a></code> </p>
</td>
<td><p>Transform input to minimum inhibitory concentrations</p></td>
<td><p>Transform input to minimum inhibitory concentrations (MIC)</p></td>
</tr><tr>
<td>
@ -544,18 +544,6 @@
<tr>
<td>
<p><code><a href="translate.html">get_locale()</a></code> </p>
</td>
<td><p>Translate strings from AMR package</p></td>
</tr><tr>
<td>
<p><code><a href="like.html">like()</a></code> <code><a href="like.html">`%like%`</a></code> <code><a href="like.html">`%like_case%`</a></code> </p>
</td>
<td><p>Pattern Matching</p></td>
</tr><tr>
<td>
<p><code><a href="age_groups.html">age_groups()</a></code> </p>
</td>
@ -568,12 +556,6 @@
<td><p>Age in years of individuals</p></td>
</tr><tr>
<td>
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
</td>
<td><p>Join microorganisms to a data set</p></td>
</tr><tr>
<td>
<p><code><a href="availability.html">availability()</a></code> </p>
</td>
@ -581,15 +563,33 @@
</tr><tr>
<td>
<p><code><a href="pca.html">pca()</a></code> </p>
<p><code><a href="translate.html">get_locale()</a></code> </p>
</td>
<td><p>Principal Component Analysis (for AMR)</p></td>
<td><p>Translate strings from AMR package</p></td>
</tr><tr>
<td>
<p><code><a href="ggplot_pca.html">ggplot_pca()</a></code> </p>
</td>
<td><p>PCA biplot with <code>ggplot2</code></p></td>
</tr><tr>
<td>
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
</td>
<td><p>Join microorganisms to a data set</p></td>
</tr><tr>
<td>
<p><code><a href="like.html">like()</a></code> <code><a href="like.html">`%like%`</a></code> <code><a href="like.html">`%like_case%`</a></code> </p>
</td>
<td><p>Pattern Matching</p></td>
</tr><tr>
<td>
<p><code><a href="pca.html">pca()</a></code> </p>
</td>
<td><p>Principal Component Analysis (for AMR)</p></td>
</tr>
</tbody><tbody>
<tr>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with bacterial intrinsic resistance — intrinsic_resistant" />
<meta property="og:description" content="Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 49,462 observations and 2 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 49,462 observations and 2 variables:</p><ul>
<li><p><code>microorganism</code><br /> Name of the microorganism</p></li>
<li><p><code>antibiotic</code><br /> Name of the antibiotic drug</p></li>
</ul>
@ -273,7 +273,8 @@
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='kw'>antibiotic</span> <span class='op'>==</span> <span class='st'>"Vancomycin"</span>, <span class='kw'>microorganism</span> <span class='op'>%like%</span> <span class='st'>"Enterococcus"</span>) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/pull.html'>pull</a></span>(<span class='kw'>microorganism</span>)
<span class='co'># [1] "Enterococcus casseliflavus" "Enterococcus gallinarum"</span>
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Join microorganisms to a data set — join" />
<meta property="og:description" content="Join the data set microorganisms easily to an existing table or character vector." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -277,7 +277,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p><strong>Note:</strong> As opposed to the <code>join()</code> functions of <code>dplyr</code>, <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix.</p>
<p><strong>Note:</strong> As opposed to the <code>join()</code> functions of <code>dplyr</code>, <a href='https://rdrr.io/r/base/character.html'>character</a> vectors are supported and at default existing columns will get a suffix <code>"2"</code> and the newly joined columns will not get a suffix.</p>
<p>These functions rely on <code><a href='https://rdrr.io/r/base/merge.html'>merge()</a></code>, a base R function to do joins.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
@ -309,7 +309,8 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>colnames</a></span>(<span class='kw'>df</span>)
<span class='kw'>df_joined</span> <span class='op'>&lt;-</span> <span class='fu'>left_join_microorganisms</span>(<span class='kw'>df</span>, <span class='st'>"bacteria"</span>)
<span class='fu'><a href='https://rdrr.io/r/base/colnames.html'>colnames</a></span>(<span class='kw'>df_joined</span>)
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Kurtosis of the sample — kurtosis" />
<meta property="og:description" content="Kurtosis is a measure of the &quot;tailedness&quot; of the probability distribution of a real-valued random variable." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -258,7 +258,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code></p></td>
<td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></p></td>
</tr>
<tr>
<th>na.rm</th>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Pattern Matching — like" />
<meta property="og:description" content="Convenient wrapper around grep() to match a pattern: x %like% pattern. It always returns a logical vector and is always case-insensitive (use x %like_case% pattern for case-sensitive matching). Also, pattern can be as long as x to compare items of each index in both vectors, or they both can have the same length to iterate over all cases." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -257,7 +257,7 @@
</tr>
<tr>
<th>pattern</th>
<td><p>a character string containing a regular expression (or <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> string for <code>fixed = TRUE</code>) to be matched in the given character vector. Coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a character string if possible. If a <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> vector of length 2 or more is supplied, the first element is used with a warning.</p></td>
<td><p>a character string containing a regular expression (or <a href='https://rdrr.io/r/base/character.html'>character</a> string for <code>fixed = TRUE</code>) to be matched in the given character vector. Coerced by <code><a href='https://rdrr.io/r/base/character.html'>as.character()</a></code> to a character string if possible. If a <a href='https://rdrr.io/r/base/character.html'>character</a> vector of length 2 or more is supplied, the first element is used with a warning.</p></td>
</tr>
<tr>
<th>ignore.case</th>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Determine multidrug-resistant organisms (MDRO) — mdro" />
<meta property="og:description" content="Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -308,13 +308,13 @@
<ul>
<li><p>CMI 2012 paper - function <code>mdr_cmi2012()</code> or <code>mdro()</code>:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Multi-drug-resistant (MDR)</code> &lt; <code>Extensively drug-resistant (XDR)</code> &lt; <code>Pandrug-resistant (PDR)</code></p></li>
Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <code>Negative</code> &lt; <code>Multi-drug-resistant (MDR)</code> &lt; <code>Extensively drug-resistant (XDR)</code> &lt; <code>Pandrug-resistant (PDR)</code></p></li>
<li><p>TB guideline - function <code>mdr_tb()</code> or <code>mdro(..., guideline = "TB")</code>:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Mono-resistant</code> &lt; <code>Poly-resistant</code> &lt; <code>Multi-drug-resistant</code> &lt; <code>Extensively drug-resistant</code></p></li>
Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <code>Negative</code> &lt; <code>Mono-resistant</code> &lt; <code>Poly-resistant</code> &lt; <code>Multi-drug-resistant</code> &lt; <code>Extensively drug-resistant</code></p></li>
<li><p>German guideline - function <code>mrgn()</code> or <code>mdro(..., guideline = "MRGN")</code>:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>3MRGN</code> &lt; <code>4MRGN</code></p></li>
Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <code>Negative</code> &lt; <code>3MRGN</code> &lt; <code>4MRGN</code></p></li>
<li><p>Everything else:<br />
Ordered <code><a href='https://rdrr.io/r/base/factor.html'>factor</a></code> with levels <code>Negative</code> &lt; <code>Positive, unconfirmed</code> &lt; <code>Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests</p></li>
Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <code>Negative</code> &lt; <code>Positive, unconfirmed</code> &lt; <code>Positive</code>. The value <code>"Positive, unconfirmed"</code> means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests</p></li>
</ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
@ -459,7 +459,8 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate</a></span>(EUCAST = <span class='fu'>eucast_exceptional_phenotypes</span>(<span class='kw'>.</span>),
BRMO = <span class='fu'>brmo</span>(<span class='kw'>.</span>),
MRGN = <span class='fu'>mrgn</span>(<span class='kw'>.</span>))
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with 5,583 common microorganism codes — microorganisms.codes" />
<meta property="og:description" content="A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with set_mo_source(). They will all be searched when using as.mo() and consequently all the mo_* functions." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 5,583 observations and 2 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 5,583 observations and 2 variables:</p><ul>
<li><p><code>code</code><br /> Commonly used code of a microorganism</p></li>
<li><p><code>mo</code><br /> ID of the microorganism in the <a href='microorganisms.html'>microorganisms</a> data set</p></li>
</ul>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with 67,151 microorganisms — microorganisms" />
<meta property="og:description" content="A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using as.mo()." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 67,151 observations and 16 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 67,151 observations and 16 variables:</p><ul>
<li><p><code>mo</code><br /> ID of microorganism as used by this package</p></li>
<li><p><code>fullname</code><br /> Full name, like <code>"Escherichia coli"</code></p></li>
<li><p><code>kingdom</code>, <code>phylum</code>, <code>class</code>, <code>order</code>, <code>family</code>, <code>genus</code>, <code>species</code>, <code>subspecies</code><br /> Taxonomic rank of the microorganism</p></li>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set with previously accepted taxonomic names — microorganisms.old" />
<meta property="og:description" content="A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by as.mo()." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 12,708 observations and 4 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 12,708 observations and 4 variables:</p><ul>
<li><p><code>fullname</code><br /> Old full taxonomic name of the microorganism</p></li>
<li><p><code>fullname_new</code><br /> New full taxonomic name of the microorganism</p></li>
<li><p><code>ref</code><br /> Author(s) and year of concerning scientific publication</p></li>

View File

@ -0,0 +1,308 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculate the matching score for microorganisms — mo_matching_score • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
<!-- bootstrap-toc -->
<link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script>
<meta property="og:title" content="Calculate the matching score for microorganisms — mo_matching_score" />
<meta property="og:description" content="This helper function is used by as.mo() to determine the most probable match of taxonomic records, based on user input." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
<!-- 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>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</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">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</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.3.0.9022</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
How to
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fa fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fa fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
Other: benchmarks
</a>
</li>
</ul>
</li>
<li>
<a href="../reference/index.html">
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/index.html">
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="../survey.html">
<span class="fa fa-clipboard-list"></span>
Survey
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Calculate the matching score for microorganisms</h1>
<small class="dont-index">Source: <a href='https://github.com/msberends/AMR/blob/master/R/mo_matching_score.R'><code>R/mo_matching_score.R</code></a></small>
<div class="hidden name"><code>mo_matching_score.Rd</code></div>
</div>
<div class="ref-description">
<p>This helper function is used by <code><a href='as.mo.html'>as.mo()</a></code> to determine the most probable match of taxonomic records, based on user input.</p>
</div>
<pre class="usage"><span class='fu'>mo_matching_score</span>(<span class='kw'>x</span>, <span class='kw'>fullname</span>, uncertainty = <span class='fl'>1</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>Any user input value(s)</p></td>
</tr>
<tr>
<th>fullname</th>
<td><p>A full taxonomic name, that exists in <code><a href='microorganisms.html'>microorganisms$fullname</a></code></p></td>
</tr>
<tr>
<th>uncertainty</th>
<td><p>The level of uncertainty set in <code><a href='as.mo.html'>as.mo()</a></code>, see <code>allow_uncertain</code> in that function (here, it defaults to 1, but is automatically determined in <code><a href='as.mo.html'>as.mo()</a></code> based on the number of transformations needed to get to a result)</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The matching score is based on four parameters:</p><ol>
<li><p>A human pathogenic prevalence \(P\), that is categorised into group 1, 2 and 3 (see <code><a href='as.mo.html'>as.mo()</a></code>);</p></li>
<li><p>A kingdom index \(K\) is set as follows: Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, and all others = 5;</p></li>
<li><p>The level of uncertainty \(U\) that is needed to get to a result (1 to 3, see <code><a href='as.mo.html'>as.mo()</a></code>);</p></li>
<li><p>The <a href='https://en.wikipedia.org/wiki/Levenshtein_distance'>Levenshtein distance</a> \(L\) is the distance between the user input and all taxonomic full names, with the text length of the user input being the maximum distance. A modified version of the Levenshtein distance \(L'\) based on the text length of the full name \(F\) is calculated as:</p></li>
</ol>
<p>$$L' = F - \frac{0.5 \times L}{F}$$</p>
<p>The final matching score \(M\) is calculated as:
$$M = L' \times \frac{1}{P \times K} * \frac{1}{U}$$</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)
<span class='fu'><a href='as.mo.html'>mo_uncertainties</a></span>()
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
<h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<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>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
</div>
</footer>
</div>
</body>
</html>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Get properties of a microorganism — mo_property" />
<meta property="og:description" content="Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with as.mo(), which makes it possible to use microbial abbreviations, codes and names as input. Please see Examples." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9018</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -319,11 +319,11 @@
<ul>
<li><p>An <code><a href='https://rdrr.io/r/base/integer.html'>integer</a></code> in case of <code>mo_year()</code></p></li>
<li><p>A <code><a href='https://rdrr.io/r/base/list.html'>list</a></code> in case of <code>mo_taxonomy()</code> and <code>mo_info()</code></p></li>
<li><p>A named <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in case of <code>mo_url()</code></p></li>
<li><p>A <code><a href='https://rdrr.io/r/base/double.html'>double</a></code> in case of <code>mo_snomed()</code></p></li>
<li><p>A <code><a href='https://rdrr.io/r/base/character.html'>character</a></code> in all other cases</p></li>
<li><p>An <a href='https://rdrr.io/r/base/integer.html'>integer</a> in case of <code>mo_year()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/list.html'>list</a> in case of <code>mo_taxonomy()</code> and <code>mo_info()</code></p></li>
<li><p>A named <a href='https://rdrr.io/r/base/character.html'>character</a> in case of <code>mo_url()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/double.html'>double</a> in case of <code>mo_snomed()</code></p></li>
<li><p>A <a href='https://rdrr.io/r/base/character.html'>character</a> in all other cases</p></li>
</ul>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

View File

@ -51,7 +51,7 @@
<meta property="og:title" content="User-defined reference data set for microorganisms — mo_source" />
<meta property="og:description" content="These functions can be used to predefine your own reference to be used in as.mo() and consequently all mo_* functions like mo_genus() and mo_gramstain().
This is the fastest way to have your organisation (or analysis) specific codes picked up and translated by this package." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -83,7 +83,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
</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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -259,9 +259,10 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the <code>readxl</code> package installed.</p>
<p><code>set_mo_source()</code> will check the file for validity: it must be a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code>, must have a column named <code>"mo"</code> which contains values from <code><a href='microorganisms.html'>microorganisms$mo</a></code> and must have a reference column with your own defined values. If all tests pass, <code>set_mo_source()</code> will read the file into R and export it to <code>"~/.mo_source.rds"</code>. This compressed data file will then be used at default for MO determination (function <code><a href='as.mo.html'>as.mo()</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus()</a></code> and <code><a href='mo_property.html'>mo_gramstain()</a></code>). The location of the original file will be saved as option with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source = path)</a></code>. Its timestamp will be saved with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source_datetime = ...)</a></code>.</p>
<p><code>get_mo_source()</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><a href='https://rdrr.io/r/base/readRDS.html'>readRDS()</a></code>. If the original file has changed (the file defined with <code>path</code>), it will call <code>set_mo_source()</code> to update the data file automatically.</p>
<p>The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you will need to have the <code>readxl</code> package installed.</p>
<p><code>set_mo_source()</code> will check the file for validity: it must be a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, must have a column named <code>"mo"</code> which contains values from <code><a href='microorganisms.html'>microorganisms$mo</a></code> and must have a reference column with your own defined values. If all tests pass, <code>set_mo_source()</code> will read the file into R and export it to <code>"~/.mo_source.rds"</code> after the user <strong>specifically confirms and allows</strong> that this file will be created. For this reason, this function only works in interactive sessions.</p>
<p>The created compressed data file <code>"~/.mo_source.rds"</code> will be used at default for MO determination (function <code><a href='as.mo.html'>as.mo()</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus()</a></code> and <code><a href='mo_property.html'>mo_gramstain()</a></code>). The location of the original file will be saved as an R option with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source = path)</a></code>. Its timestamp will be saved with <code><a href='https://rdrr.io/r/base/options.html'>options(mo_source_datetime = ...)</a></code>.</p>
<p>The function <code>get_mo_source()</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><a href='https://rdrr.io/r/base/readRDS.html'>readRDS()</a></code>. If the original file has changed (by checking the aforementioned options <code>mo_source</code> and <code>mo_source_datetime</code>), it will call <code>set_mo_source()</code> to update the data file automatically.</p>
<p>Reading an Excel file (<code>.xlsx</code>) with only one row has a size of 8-9 kB. The compressed file created with <code>set_mo_source()</code> will then have a size of 0.1 kB and can be read by <code>get_mo_source()</code> in only a couple of microseconds (millionths of a second).</p>
<h2 class="hasAnchor" id="how-to-setup"><a class="anchor" href="#how-to-setup"></a>How to setup</h2>
@ -278,7 +279,8 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<p>We save it as <code>"home/me/ourcodes.xlsx"</code>. Now we have to set it as a source:</p><pre><span class='fu'>set_mo_source</span>(<span class='st'>"home/me/ourcodes.xlsx"</span>)
<span class='co'>#&gt; NOTE: Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'</span>
<span class='co'>#&gt; (columns "Organisation XYZ" and "mo")</span></pre>
<span class='co'>#&gt; (columns "Organisation XYZ" and "mo")</span>
</pre>
<p>It has now created a file <code>"~/.mo_source.rds"</code> with the contents of our Excel file. Only the first column with foreign values and the 'mo' column will be kept when creating the RDS file.</p>
<p>And now we can use it in our functions:</p><pre><span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"lab_mo_ecoli"</span>)
@ -289,7 +291,8 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<span class='co'># other input values still work too</span>
<span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"Escherichia coli"</span>, <span class='st'>"E. coli"</span>, <span class='st'>"lab_mo_ecoli"</span>))
<span class='co'>#&gt; [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI</span></pre>
<span class='co'>#&gt; [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI</span>
</pre>
<p>If we edit the Excel file by, let's say, adding row 4 like this:</p><pre> | A | B |
--|--------------------|--------------|
@ -306,10 +309,12 @@ This is the fastest way to have your organisation (or analysis) specific codes p
<span class='co'>#&gt; [1] B_ESCHR_COLI</span>
<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='st'>"lab_Staph_aureus"</span>)
<span class='co'>#&gt; [1] "Staphylococcus"</span></pre>
<span class='co'>#&gt; [1] "Staphylococcus"</span>
</pre>
<p>To delete the reference data file, just use <code>""</code>, <code>NULL</code> or <code>FALSE</code> as input for <code>set_mo_source()</code>:</p><pre><span class='fu'>set_mo_source</span>(<span class='kw'>NULL</span>)
<span class='co'># Removed mo_source file '~/.mo_source.rds'.</span></pre>
<span class='co'># Removed mo_source file '~/.mo_source.rds'.</span>
</pre>
<p>If the original Excel file is moved or deleted, the mo_source file will be removed upon the next use of <code><a href='as.mo.html'>as.mo()</a></code>. If the mo_source file is manually deleted (i.e. without using <code>set_mo_source()</code>), the references to the mo_source file will be removed upon the next use of <code><a href='as.mo.html'>as.mo()</a></code>.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Plotting for classes rsi and disk — plot" />
<meta property="og:description" content="Functions to print classes of the AMR package." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9016</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>

View File

@ -51,7 +51,7 @@
<meta property="og:title" content="Calculate microbial resistance — proportion" />
<meta property="og:description" content="These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in summarise() from the dplyr package and also support grouped variables, please see Examples.
resistance() should be used to calculate resistance, susceptibility() should be used to calculate susceptibility." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -83,7 +83,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -299,7 +299,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
</tr>
<tr>
<th>data</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing columns with class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing columns with class <code><a href='as.rsi.html'>rsi</a></code> (see <code><a href='as.rsi.html'>as.rsi()</a></code>)</p></td>
</tr>
<tr>
<th>translate_ab</th>
@ -324,7 +324,7 @@ resistance() should be used to calculate resistance, susceptibility() should be
<p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition</strong>, 2014, <em>Clinical and Laboratory Standards Institute (CLSI)</em>. <a href='https://clsi.org/standards/products/microbiology/documents/m39/'>https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A <code><a href='https://rdrr.io/r/base/double.html'>double</a></code> or, when <code>as_percent = TRUE</code>, a <code><a href='https://rdrr.io/r/base/character.html'>character</a></code>.</p>
<p>A <a href='https://rdrr.io/r/base/double.html'>double</a> or, when <code>as_percent = TRUE</code>, a <a href='https://rdrr.io/r/base/character.html'>character</a>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>resistance()</code> is equal to the function <code>proportion_R()</code>. The function <code>susceptibility()</code> is equal to the function <code>proportion_SI()</code>.</p>
@ -354,10 +354,12 @@ resistance() should be used to calculate resistance, susceptibility() should be
</pre>
<p>Please note that, in combination therapies, for <code>only_all_tested = TRUE</code> applies that:</p><pre> <span class='fu'><a href='count.html'>count_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='count.html'>count_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='count.html'>count_R</a></span>() <span class='op'>=</span> <span class='fu'><a href='count.html'>count_all</a></span>()
<span class='fu'>proportion_S</span>() <span class='op'>+</span> <span class='fu'>proportion_I</span>() <span class='op'>+</span> <span class='fu'>proportion_R</span>() <span class='op'>=</span> <span class='fl'>1</span></pre>
<span class='fu'>proportion_S</span>() <span class='op'>+</span> <span class='fu'>proportion_I</span>() <span class='op'>+</span> <span class='fu'>proportion_R</span>() <span class='op'>=</span> <span class='fl'>1</span>
</pre>
<p>and that, in combination therapies, for <code>only_all_tested = FALSE</code> applies that:</p><pre> <span class='fu'><a href='count.html'>count_S</a></span>() <span class='op'>+</span> <span class='fu'><a href='count.html'>count_I</a></span>() <span class='op'>+</span> <span class='fu'><a href='count.html'>count_R</a></span>() <span class='op'>&gt;=</span> <span class='fu'><a href='count.html'>count_all</a></span>()
<span class='fu'>proportion_S</span>() <span class='op'>+</span> <span class='fu'>proportion_I</span>() <span class='op'>+</span> <span class='fu'>proportion_R</span>() <span class='op'>&gt;=</span> <span class='fl'>1</span></pre>
<span class='fu'>proportion_S</span>() <span class='op'>+</span> <span class='fu'>proportion_I</span>() <span class='op'>+</span> <span class='fu'>proportion_R</span>() <span class='op'>&gt;=</span> <span class='fl'>1</span>
</pre>
<p>Using <code>only_all_tested</code> has no impact when only using one antibiotic as input.</p>
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
@ -470,7 +472,8 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class='kw'>genus</span> <span class='op'>==</span> <span class='st'>"Helicobacter"</span>) <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span>(p = <span class='fu'>susceptibility</span>(<span class='kw'>AMX</span>, <span class='kw'>MTR</span>), <span class='co'># amoxicillin with metronidazole</span>
n = <span class='fu'><a href='count.html'>count_all</a></span>(<span class='kw'>AMX</span>, <span class='kw'>MTR</span>))
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Predict antimicrobial resistance — resistance_predict" />
<meta property="og:description" content="Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns se_min and se_max. See Examples for a real live example." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -273,7 +273,7 @@
)
<span class='co'># S3 method for resistance_predict</span>
<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span>(<span class='kw'>x</span>, main = <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='kw'>x_name</span>), <span class='kw'>...</span>)
<span class='fu'><a href='plot.html'>plot</a></span>(<span class='kw'>x</span>, main = <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Resistance Prediction of"</span>, <span class='kw'>x_name</span>), <span class='kw'>...</span>)
<span class='fu'>ggplot_rsi_predict</span>(
<span class='kw'>x</span>,
@ -287,7 +287,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> containing isolates.</p></td>
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates.</p></td>
</tr>
<tr>
<th>col_ab</th>
@ -345,7 +345,7 @@
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with extra class <code>resistance_predict</code> with columns:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with extra class <code>resistance_predict</code> with columns:</p><ul>
<li><p><code>year</code></p></li>
<li><p><code>value</code>, the same as <code>estimated</code> when <code>preserve_measurements = FALSE</code>, and a combination of <code>observed</code> and <code>estimated</code> otherwise</p></li>
<li><p><code>se_min</code>, the lower bound of the standard error with a minimum of <code>0</code> (so the standard error will never go below 0%)</p></li>
@ -399,7 +399,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
col_ab = <span class='st'>"AMX"</span>,
year_min = <span class='fl'>2010</span>,
model = <span class='st'>"binomial"</span>)
<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span>(<span class='kw'>x</span>)
<span class='fu'><a href='plot.html'>plot</a></span>(<span class='kw'>x</span>)
<span class='co'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/library.html'>require</a></span>(<span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span>)) {
<span class='fu'>ggplot_rsi_predict</span>(<span class='kw'>x</span>)
}
@ -410,7 +410,7 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
<span class='fu'><a href='first_isolate.html'>filter_first_isolate</a></span>() <span class='op'>%&gt;%</span>
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='kw'>mo</span>) <span class='op'>==</span> <span class='st'>"Staphylococcus"</span>) <span class='op'>%&gt;%</span>
<span class='fu'>resistance_predict</span>(<span class='st'>"PEN"</span>, model = <span class='st'>"binomial"</span>)
<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span>(<span class='kw'>x</span>)
<span class='fu'><a href='plot.html'>plot</a></span>(<span class='kw'>x</span>)
<span class='co'># get the model from the object</span>
<span class='kw'>mymodel</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/attributes.html'>attributes</a></span>(<span class='kw'>x</span>)<span class='op'>$</span><span class='kw'>model</span>
@ -445,7 +445,8 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
y = <span class='st'>"%R"</span>,
x = <span class='st'>"Year"</span>) <span class='op'>+</span>
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_minimal</a></span>(base_size = <span class='fl'>13</span>)
}</pre>
}
</pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">

View File

@ -50,7 +50,7 @@
<meta property="og:title" content="Data set for R/SI interpretation — rsi_translation" />
<meta property="og:description" content="Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2010-2019) and EUCAST (2011-2020). Use as.rsi() to transform MICs or disks measurements to R/SI values." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -82,7 +82,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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -247,7 +247,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code> with 18,650 observations and 10 variables:</p><ul>
<p>A <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with 18,650 observations and 10 variables:</p><ul>
<li><p><code>guideline</code><br /> Name of the guideline</p></li>
<li><p><code>method</code><br /> Either "MIC" or "DISK"</p></li>
<li><p><code>site</code><br /> Body site, e.g. "Oral" or "Respiratory"</p></li>

View File

@ -51,7 +51,7 @@
<meta property="og:title" content="Skewness of the sample — skewness" />
<meta property="og:description" content="Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean.
When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure." />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
@ -83,7 +83,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
</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.3.0.9015</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>
@ -260,7 +260,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <code><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></code></p></td>
<td><p>a vector of values, a <code><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></code> or a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></p></td>
</tr>
<tr>
<th>na.rm</th>

View File

@ -82,7 +82,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.3.0.9020</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9022</span>
</span>
</div>