<!-- Generated by pkgdown: do not edit by hand --><htmllang="en"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><metaname="description"content="Interpretminimuminhibitoryconcentration(MIC)valuesanddiskdiffusiondiametersaccordingtoEUCASTorCLSI,orcleanupexistingSIRvalues.Thistransformstheinputtoanewclasssir,whichisanorderedfactorwithlevelsS&lt;I&lt;R.
All breakpoints used for interpretation are publicly available in the clinical_breakpoints data set."><title>Translate MIC and Disk Diffusion to SIR, or Clean Existing SIR Data — as.sir • AMR (for R)</title><!-- favicons --><linkrel="icon"type="image/png"sizes="16x16"href="../favicon-16x16.png"><linkrel="icon"type="image/png"sizes="32x32"href="../favicon-32x32.png"><linkrel="apple-touch-icon"type="image/png"sizes="180x180"href="../apple-touch-icon.png"><linkrel="apple-touch-icon"type="image/png"sizes="120x120"href="../apple-touch-icon-120x120.png"><linkrel="apple-touch-icon"type="image/png"sizes="76x76"href="../apple-touch-icon-76x76.png"><linkrel="apple-touch-icon"type="image/png"sizes="60x60"href="../apple-touch-icon-60x60.png"><scriptsrc="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><linkhref="../deps/bootstrap-5.2.2/bootstrap.min.css"rel="stylesheet"><scriptsrc="../deps/bootstrap-5.2.2/bootstrap.bundle.min.js"></script><linkhref="../deps/Fira_Code-0.4.5/font.css"rel="stylesheet"><!-- Font Awesome icons --><linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css"integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk="crossorigin="anonymous"><linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css"integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw="crossorigin="anonymous"><!-- bootstrap-toc --><scriptsrc="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js"integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo="crossorigin="anonymous"></script><!-- headroom.js --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js"integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js"integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4="crossorigin="anonymous"></script><!-- clipboard.js --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI="crossorigin="anonymous"></script><!-- search --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js"integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A=="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js"integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg=="crossorigin="anonymous"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js"integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww=="crossorigin="anonymous"></script><!-- pkgdown --><scriptsrc="../pkgdown.js"></script><linkhref="../extra.css"rel="stylesheet"><scriptsrc="../extra.js"></script><metaproperty="og:title"content="Translate MIC and Disk Diffusion to SIR, or Clean Existing SIR Data — as.sir"><metaproperty="og:description"content="Interpretminimuminhibitoryconcentration(MIC)valuesanddiskdiffusiondiametersaccordingtoEUCASTorCLSI,orcleanupexistingSIRvalues.Thistransformstheinputtoanewclasssir,whichisanorderedfactorwithlevelsS&lt;I&lt;R.
All breakpoints used for interpretation are publicly available in the clinical_breakpoints data set."><metaproperty="og:image"content="https://msberends.github.io/AMR/logo.svg"><metaname="twitter:card"content="summary_large_image"><metaname="twitter:creator"content="@msberends"><metaname="twitter:site"content="@msberends"><!-- mathjax --><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k="crossorigin="anonymous"></script><scriptsrc="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]>
<p>Interpret minimum inhibitory concentration (MIC) values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing SIR values. This transforms the input to a new class <code>sir</code>, which is an ordered <ahref="https://rdrr.io/r/base/factor.html"class="external-link">factor</a> with levels <code>S < I < R</code>.</p>
<span> mo <spanclass="op">=</span><spanclass="cn">NULL</span>,</span>
<span> ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/deparse.html"class="external-link">deparse</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://rdrr.io/r/base/substitute.html"class="external-link">substitute</a></span><spanclass="op">(</span><spanclass="va">x</span><spanclass="op">)</span><spanclass="op">)</span>,</span>
<span> mo <spanclass="op">=</span><spanclass="cn">NULL</span>,</span>
<span> ab <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/deparse.html"class="external-link">deparse</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://rdrr.io/r/base/substitute.html"class="external-link">substitute</a></span><spanclass="op">(</span><spanclass="va">x</span><spanclass="op">)</span><spanclass="op">)</span>,</span>
<p>For interpretations of minimum inhibitory concentration (MIC) values and disk diffusion diameters:</p><ul><li><p><strong>M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data</strong>, 2013-2022, <em>Clinical and Laboratory Standards Institute</em> (CLSI). <ahref="https://clsi.org/standards/products/microbiology/documents/m39/"class="external-link">https://clsi.org/standards/products/microbiology/documents/m39/</a>.</p></li>
<li><p><strong>M100 Performance Standard for Antimicrobial Susceptibility Testing</strong>, 2013-2022, <em>Clinical and Laboratory Standards Institute</em> (CLSI). <ahref="https://clsi.org/standards/products/microbiology/documents/m100/"class="external-link">https://clsi.org/standards/products/microbiology/documents/m100/</a>.</p></li>
<li><p><strong>Breakpoint tables for interpretation of MICs and zone diameters</strong>, 2013-2022, <em>European Committee on Antimicrobial Susceptibility Testing</em> (EUCAST). <ahref="https://www.eucast.org/clinical_breakpoints"class="external-link">https://www.eucast.org/clinical_breakpoints</a>.</p></li>
<dd><p>vector of values (for class <code><ahref="as.mic.html">mic</a></code>: MIC values in mg/L, for class <code><ahref="as.disk.html">disk</a></code>: a disk diffusion radius in millimetres)</p></dd>
<dd><p>for using on a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>: names of columns to apply <code>as.sir()</code> on (supports tidy selection such as <code>column1:column4</code>). Otherwise: arguments passed on to methods.</p></dd>
<dd><p>maximum fraction of invalid antimicrobial interpretations of <code>x</code>, see <em>Examples</em></p></dd>
<dt>mo</dt>
<dd><p>any (vector of) text that can be coerced to valid microorganism codes with <code><ahref="as.mo.html">as.mo()</a></code>, can be left empty to determine it automatically</p></dd>
<dd><p>defaults to EUCAST 2022 (the latest implemented EUCAST guideline in the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set), but can be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_guideline</a></code>. Currently supports EUCAST (2013-2022) and CLSI (2013-2022), see <em>Details</em>.</p></dd>
<dd><p>(Urinary Tract Infection) A vector with <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.sir()</code> on a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, this can also be a column containing <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a>s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See <em>Examples</em>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that MIC values starting with <code>">"</code> (but not <code>">="</code>) must always return "R" , and that MIC values starting with <code>"<"</code> (but not <code>"<="</code>) must always return "S"</p></dd>
<dt>add_intrinsic_resistance</dt>
<dd><p><em>(only useful when using a EUCAST guideline)</em> a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in <em>Klebsiella</em> species. Determination is based on the <ahref="intrinsic_resistant.html">intrinsic_resistant</a> data set, that itself is based on <ahref="https://www.eucast.org/expert_rules_and_expected_phenotypes/"class="external-link">'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3</a> (2021).</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a> to be used for interpretation, which defaults to the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the <ahref="clinical_breakpoints.html">clinical_breakpoints</a> data set (same column names and column types). Please note that the <code>guideline</code> argument will be ignored when <code>reference_data</code> is manually set.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that clinical breakpoints for screening are allowed - the default is <code>FALSE</code>. Can also be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_include_screening</a></code>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is <code>TRUE</code>. Can also be set with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_include_PKPD</a></code>.</p></dd>
<dd><p>column name of the names or codes of the microorganisms (see <code><ahref="as.mo.html">as.mo()</a></code>) - the default is the first column of class <code><ahref="as.mo.html">mo</a></code>. Values will be coerced using <code><ahref="as.mo.html">as.mo()</a></code>.</p></dd>
<dd><p>a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> to indicate whether previously stored results should be forgotten after returning the 'logbook' with results</p></dd>
<p>The <code>as.sir()</code> function works in four ways:</p><ol><li><p>For <strong>cleaning raw / untransformed data</strong>. The data will be cleaned to only contain values S, I and R and will try its best to determine this with some intelligence. For example, mixed values with SIR interpretations and MIC values such as <code>"<0.25; S"</code> will be coerced to <code>"S"</code>. Combined interpretations for multiple test methods (as seen in laboratory records) such as <code>"S; S"</code> will be coerced to <code>"S"</code>, but a value like <code>"S; I"</code> will return <code>NA</code> with a warning that the input is unclear.</p></li>
<li><p>For <strong>interpreting minimum inhibitory concentration (MIC) values</strong> according to EUCAST or CLSI. You must clean your MIC values first using <code><ahref="as.mic.html">as.mic()</a></code>, that also gives your columns the new data class <code><ahref="as.mic.html">mic</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, SIR interpretation can be done very easily with either:</p>
<li><p>Operators like "<=" will be stripped before interpretation. When using <code>conserve_capped_values = TRUE</code>, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (<code>conserve_capped_values = FALSE</code>) considers ">2" to be lower than ">=4" and might in this case return "S" or "I".</p></li>
<li><p>For <strong>interpreting disk diffusion diameters</strong> according to EUCAST or CLSI. You must clean your disk zones first using <code><ahref="as.disk.html">as.disk()</a></code>, that also gives your columns the new data class <code><ahref="as.disk.html">disk</a></code>. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the <code>mo</code> argument.</p><ul><li><p>Using <code>dplyr</code>, SIR interpretation can be done very easily with either:</p>
<li><p>For <strong>interpreting a complete data set</strong>, with automatic determination of MIC values, disk diffusion diameters, microorganism names or codes, and antimicrobial test results. This is done very simply by running <code>as.sir(your_data)</code>.</p></li>
</ol><p><strong>For points 2, 3 and 4: Use <code>sir_interpretation_history()</code></strong> to retrieve a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a> (or <ahref="https://tibble.tidyverse.org/reference/tibble.html"class="external-link">tibble</a> if the <code>tibble</code> package is installed) with all results of the last <code>as.sir()</code> call.</p>
<p>Thus, the <code>guideline</code> argument must be set to e.g., <code>"EUCAST 2022"</code> or <code>"CLSI 2022"</code>. By simply using <code>"EUCAST"</code> (the default) or <code>"CLSI"</code> as input, the latest included version of that guideline will automatically be selected. You can set your own data set using the <code>reference_data</code> argument. The <code>guideline</code> argument will then be ignored.</p>
<p>You can set the default guideline with the <ahref="AMR-options.html">package option</a><code><ahref="AMR-options.html">AMR_guideline</a></code> (e.g. in your <code>.Rprofile</code> file), such as:</p>
<p>After using <code>as.sir()</code>, you can use the <code><ahref="eucast_rules.html">eucast_rules()</a></code> defined by EUCAST to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.</p>
<p>The repository of this package <ahref="https://github.com/msberends/AMR/blob/main/data-raw/clinical_breakpoints.txt"class="external-link">contains a machine-readable version</a> of all guidelines. This is a CSV file consisting of 18 308 rows and 11 columns. This file is machine-readable, since it contains one row for every unique combination of the test method (MIC or disk diffusion), the antimicrobial drug and the microorganism. <strong>This allows for easy implementation of these rules in laboratory information systems (LIS)</strong>. Note that it only contains interpretation guidelines for humans - interpretation guidelines from CLSI for animals were removed.</p>
<p>The function <code>is.sir()</code> detects if the input contains class <code>sir</code>. If the input is a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, it iterates over all columns and returns a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> vector.</p>
<p>The function <code>is_sir_eligible()</code> returns <code>TRUE</code> when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), and <code>FALSE</code> otherwise. The threshold of 5% can be set with the <code>threshold</code> argument. If the input is a <ahref="https://rdrr.io/r/base/data.frame.html"class="external-link">data.frame</a>, it iterates over all columns and returns a <ahref="https://rdrr.io/r/base/logical.html"class="external-link">logical</a> vector.</p>
<p><code>NA_sir_</code> is a missing value of the new <code>sir</code> class, analogous to e.g. base <spanstyle="R">R</span>'s <code><ahref="https://rdrr.io/r/base/NA.html"class="external-link">NA_character_</a></code>.</p>
<p>In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I, and R as shown below (<ahref="https://www.eucast.org/newsiandr/"class="external-link">https://www.eucast.org/newsiandr/</a>):</p><ul><li><p><strong>S - Susceptible, standard dosing regimen</strong><br>
A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.</p></li>
A microorganism is categorised as "Susceptible, Increased exposure</em>" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.</p></li>
<li><p><strong>R = Resistant</strong><br>
A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.</p><ul><li><p><em>Exposure</em> is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.</p></li>
</ul><p>This AMR package honours this insight. Use <code><ahref="proportion.html">susceptibility()</a></code> (equal to <code><ahref="proportion.html">proportion_SI()</a></code>) to determine antimicrobial susceptibility and <code><ahref="count.html">count_susceptible()</a></code> (equal to <code><ahref="count.html">count_SI()</a></code>) to count susceptible isolates.</p>
<h2id="reference-data-publicly-available">Reference Data Publicly Available<aclass="anchor"aria-label="anchor"href="#reference-data-publicly-available"></a></h2>
<p>All data sets in this <code>AMR</code> package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, SAS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit <ahref="https://msberends.github.io/AMR/articles/datasets.html">our website for the download links</a>. The actual files are of course available on <ahref="https://github.com/msberends/AMR/tree/main/data-raw"class="external-link">our GitHub repository</a>.</p>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 1</span> 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 2</span> 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 3</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 4</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 5</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 6</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 7</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 8</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 9</span> 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;">10</span> 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #949494;"># … with 1,990 more rows, and 36 more variables: AMC <sir>, AMP <sir>,</span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://rdrr.io/r/base/summary.html"class="external-link">summary</a></span><spanclass="op">(</span><spanclass="va">example_isolates</span><spanclass="op">)</span><spanclass="co"># see all SIR results at a glance</span></span></span>
<spanclass="r-in"><span> GEN <spanclass="op">=</span><spanclass="fu"><ahref="as.disk.html">as.disk</a></span><spanclass="op">(</span><spanclass="fl">18</span><spanclass="op">)</span>,</span></span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #949494;"># … with 40 more rows, 5 more variables: ref_table <chr>, method <chr>,</span></span>
<spanclass="r-in"><span> x <spanclass="op">=</span><spanclass="fu"><ahref="as.mic.html">as.mic</a></span><spanclass="op">(</span><spanclass="fl">2</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> mo <spanclass="op">=</span><spanclass="fu"><ahref="as.mo.html">as.mo</a></span><spanclass="op">(</span><spanclass="st">"S. pneumoniae"</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> ab <spanclass="op">=</span><spanclass="st">"AMP"</span>,</span></span>
<spanclass="r-in"><span> x <spanclass="op">=</span><spanclass="fu"><ahref="as.disk.html">as.disk</a></span><spanclass="op">(</span><spanclass="fl">18</span><spanclass="op">)</span>,</span></span>
<spanclass="r-in"><span> mo <spanclass="op">=</span><spanclass="st">"Strep pneu"</span>, <spanclass="co"># `mo` will be coerced with as.mo()</span></span></span>
<spanclass="r-in"><span> ab <spanclass="op">=</span><spanclass="st">"ampicillin"</span>, <spanclass="co"># and `ab` with as.ab()</span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_at</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/vars.html"class="external-link">vars</a></span><spanclass="op">(</span><spanclass="va">AMP</span><spanclass="op">:</span><spanclass="va">TOB</span><spanclass="op">)</span>, <spanclass="va">as.sir</span>, mo <spanclass="op">=</span><spanclass="va">.</span><spanclass="op">$</span><spanclass="va">microorganism</span><spanclass="op">)</span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/mutate_all.html"class="external-link">mutate_at</a></span><spanclass="op">(</span><spanclass="fu"><ahref="https://dplyr.tidyverse.org/reference/vars.html"class="external-link">vars</a></span><spanclass="op">(</span><spanclass="va">AMP</span><spanclass="op">:</span><spanclass="va">TOB</span><spanclass="op">)</span>, <spanclass="va">as.sir</span>, mo <spanclass="op">=</span><spanclass="st">"E. coli"</span>, uti <spanclass="op">=</span><spanclass="cn">TRUE</span><spanclass="op">)</span></span></span>
<spanclass="r-wrn co"><spanclass="r-pr">#></span><spanclass="warning">Warning: </span>in as.sir(): interpretation of nitrofurantoin (NIT) is only available for</span>
<spanclass="r-wrn co"><spanclass="r-pr">#></span><spanclass="warning">Warning: </span>in as.sir(): interpretation of nitrofurantoin (NIT) is only available for</span>
<spanclass="r-wrn co"><spanclass="r-pr">#></span><spanclass="warning">Warning: </span>in as.sir(): 3 results in column '24' truncated (50%) that were invalid</span>
<spanclass="r-in"><span><spanclass="fu"><ahref="plot.html">plot</a></span><spanclass="op">(</span><spanclass="va">sir_data</span><spanclass="op">)</span><spanclass="co"># for percentages</span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://rdrr.io/r/graphics/barplot.html"class="external-link">barplot</a></span><spanclass="op">(</span><spanclass="va">sir_data</span><spanclass="op">)</span><spanclass="co"># for frequencies</span></span></span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 1</span> 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 2</span> 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 3</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 4</span> 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 5</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 6</span> 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 7</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 8</span> 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;"> 9</span> 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #BCBCBC;">10</span> 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA </span>
<spanclass="r-out co"><spanclass="r-pr">#></span><spanstyle="color: #949494;"># … with 1,990 more rows, and 36 more variables: AMC <sir>, AMP <sir>,</span></span>
<p></p><p><code>AMR</code> (for R). Free and open-source, licenced under the <atarget="_blank"href="https://github.com/msberends/AMR/blob/main/LICENSE"class="external-link">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <atarget="_blank"href="https://www.rug.nl"class="external-link">University of Groningen</a> and <atarget="_blank"href="https://www.umcg.nl"class="external-link">University Medical Center Groningen</a> in The Netherlands.</p>