* Function `rsi_df()` to transform a `data.frame` to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions `count_df()` and `portion_df()` to immediately show resistance percentages and number of available isolates:
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 15 June 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <ahref="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 18 June 2019.</p>
<p>So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><ahref="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<aclass="sourceLine"id="cb14-25"title="25"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,340 new changes)</span></a>
<aclass="sourceLine"id="cb14-25"title="25"><spanclass="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,339 new changes)</span></a>
<aclass="sourceLine"id="cb14-26"title="26"><spanclass="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no new changes)</span></a>
<aclass="sourceLine"id="cb14-27"title="27"><spanclass="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no new changes)</span></a>
<aclass="sourceLine"id="cb14-28"title="28"><spanclass="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,785 new changes)</span></a>
<aclass="sourceLine"id="cb14-28"title="28"><spanclass="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,671 new changes)</span></a>
<aclass="sourceLine"id="cb14-29"title="29"><spanclass="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no new changes)</span></a>
<aclass="sourceLine"id="cb14-30"title="30"><spanclass="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no new changes)</span></a>
<aclass="sourceLine"id="cb14-31"title="31"><spanclass="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no new changes)</span></a>
@ -457,24 +457,24 @@
<aclass="sourceLine"id="cb14-33"title="33"><spanclass="co"># Table 13: Interpretive rules for quinolones (no new changes)</span></a>
<aclass="sourceLine"id="cb14-35"title="35"><spanclass="co"># Other rules</span></a>
<aclass="sourceLine"id="cb14-36"title="36"><spanclass="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,164 new changes)</span></a>
<aclass="sourceLine"id="cb14-37"title="37"><spanclass="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (105 new changes)</span></a>
<aclass="sourceLine"id="cb14-36"title="36"><spanclass="co"># Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,233 new changes)</span></a>
<aclass="sourceLine"id="cb14-37"title="37"><spanclass="co"># Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (92 new changes)</span></a>
<aclass="sourceLine"id="cb14-38"title="38"><spanclass="co"># Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no new changes)</span></a>
<aclass="sourceLine"id="cb14-39"title="39"><spanclass="co"># Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no new changes)</span></a>
<aclass="sourceLine"id="cb14-40"title="40"><spanclass="co"># Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no new changes)</span></a>
<aclass="sourceLine"id="cb14-41"title="41"><spanclass="co"># Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no new changes)</span></a>
<aclass="sourceLine"id="cb14-56"title="56"><spanclass="co"># Use verbose = TRUE to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -502,8 +502,8 @@
<aclass="sourceLine"id="cb16-3"title="3"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<aclass="sourceLine"id="cb16-4"title="4"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `date` as input for `col_date`.</span></a>
<aclass="sourceLine"id="cb16-5"title="5"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb16-6"title="6"><spanclass="co"># => Found 5,652 first isolates (28.3% of total)</span></a></code></pre></div>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<aclass="sourceLine"id="cb16-6"title="6"><spanclass="co"># => Found 5,673 first isolates (28.4% of total)</span></a></code></pre></div>
<p>So only 28.4% is suitable for resistance analysis! We can now filter on it with the <code><ahref="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<p>For future use, the above two syntaxes can be shortened with the <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient V3, sorted on date:</p>
<p>We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient W10, sorted on date:</p>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -529,21 +529,21 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-01-06</td>
<tdalign="center">V3</td>
<tdalign="center">2010-01-10</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-07-24</td>
<tdalign="center">V3</td>
<tdalign="center">2010-04-21</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -551,32 +551,32 @@
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-07-26</td>
<tdalign="center">V3</td>
<tdalign="center">2010-05-14</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2010-05-21</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2011-05-06</td>
<tdalign="center">V3</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2011-06-04</td>
<tdalign="center">V3</td>
<tdalign="center">2010-06-09</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -584,41 +584,41 @@
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-07-22</td>
<tdalign="center">V3</td>
<tdalign="center">2010-06-19</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-08-15</td>
<tdalign="center">V3</td>
<tdalign="center">2010-07-07</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">I</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-09-20</td>
<tdalign="center">V3</td>
<tdalign="center">2010-07-10</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2012-03-26</td>
<tdalign="center">V3</td>
<tdalign="center">2010-08-12</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -628,18 +628,18 @@
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2012-06-01</td>
<tdalign="center">V3</td>
<tdalign="center">2010-10-15</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Only 3 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><ahref="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The <code><ahref="../reference/key_antibiotics.html">key_antibiotics()</a></code> function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.</p>
<p>If a column exists with a name like ‘key(…)ab’ the <code><ahref="../reference/first_isolate.html">first_isolate()</a></code> function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:</p>
<aclass="sourceLine"id="cb19-7"title="7"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<aclass="sourceLine"id="cb19-8"title="8"><spanclass="co"># </span><spanclass="al">NOTE</span><spanclass="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<aclass="sourceLine"id="cb19-9"title="9"><spanclass="co"># [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<aclass="sourceLine"id="cb19-10"title="10"><spanclass="co"># => Found 15,202 first weighted isolates (76.0% of total)</span></a></code></pre></div>
<aclass="sourceLine"id="cb19-10"title="10"><spanclass="co"># => Found 15,099 first weighted isolates (75.5% of total)</span></a></code></pre></div>
<tableclass="table">
<thead><trclass="header">
<thalign="center">isolate</th>
@ -667,58 +667,58 @@
<tbody>
<trclass="odd">
<tdalign="center">1</td>
<tdalign="center">2010-01-06</td>
<tdalign="center">V3</td>
<tdalign="center">2010-01-10</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">2</td>
<tdalign="center">2010-07-24</td>
<tdalign="center">V3</td>
<tdalign="center">2010-04-21</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">3</td>
<tdalign="center">2010-07-26</td>
<tdalign="center">V3</td>
<tdalign="center">2010-05-14</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="even">
<tdalign="center">4</td>
<tdalign="center">2011-05-06</td>
<tdalign="center">V3</td>
<tdalign="center">2010-05-21</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">5</td>
<tdalign="center">2011-06-04</td>
<tdalign="center">V3</td>
<tdalign="center">2010-06-09</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -727,44 +727,44 @@
</tr>
<trclass="even">
<tdalign="center">6</td>
<tdalign="center">2011-07-22</td>
<tdalign="center">V3</td>
<tdalign="center">2010-06-19</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2011-08-15</td>
<tdalign="center">V3</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">I</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">7</td>
<tdalign="center">2010-07-07</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
<trclass="even">
<tdalign="center">8</td>
<tdalign="center">2011-09-20</td>
<tdalign="center">V3</td>
<tdalign="center">2010-07-10</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">R</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">TRUE</td>
</tr>
<trclass="odd">
<tdalign="center">9</td>
<tdalign="center">2012-03-26</td>
<tdalign="center">V3</td>
<tdalign="center">2010-08-12</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
@ -775,23 +775,23 @@
</tr>
<trclass="even">
<tdalign="center">10</td>
<tdalign="center">2012-06-01</td>
<tdalign="center">V3</td>
<tdalign="center">2010-10-15</td>
<tdalign="center">W10</td>
<tdalign="center">B_ESCHR_COL</td>
<tdalign="center">R</td>
<tdalign="center">I</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">TRUE</td>
<tdalign="center">TRUE</td>
<tdalign="center">S</td>
<tdalign="center">S</td>
<tdalign="center">FALSE</td>
<tdalign="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Instead of 3, now 8 isolates are flagged. In total, 76% of all isolates are marked ‘first weighted’ - 47.7% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 1, now 7 isolates are flagged. In total, 75.5% of all isolates are marked ‘first weighted’ - 47.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><ahref="../reference/first_isolate.html">filter_first_isolate()</a></code>, there’s a shortcut for this new algorithm too:</p>
<p>The functions <code><ahref="../reference/portion.html">portion_S()</a></code>, <code><ahref="../reference/portion.html">portion_SI()</a></code>, <code><ahref="../reference/portion.html">portion_I()</a></code>, <code><ahref="../reference/portion.html">portion_IR()</a></code> and <code><ahref="../reference/portion.html">portion_R()</a></code> can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (<code><ahref="../reference/portion.html">portion_R()</a></code>) and susceptibility as the portion of S and I (<code><ahref="../reference/portion.html">portion_SI()</a></code>). These functions can be used on their own:</p>
<p>Or can be used in conjuction with <code><ahref="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><ahref="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<p>To show results in plots, most R users would nowadays use the <code>ggplot2</code> package. This package lets you create plots in layers. You can read more about it <ahref="https://ggplot2.tidyverse.org/">on their website</a>. A quick example would look like these syntaxes:</p>
<p>The <code>AMR</code> package contains functions to extend this <code>ggplot2</code> package, for example <code><ahref="../reference/ggplot_rsi.html">geom_rsi()</a></code>. It automatically transforms data with <code><ahref="../reference/count.html">count_df()</a></code> or <code><ahref="../reference/portion.html">portion_df()</a></code> and show results in stacked bars. Its simplest and shortest example:</p>
<p>Omit the <code>translate_ab = FALSE</code> to have the antibiotic codes (AMX, AMC, CIP, GEN) translated to official WHO names (amoxicillin, amoxicillin/clavulanic acid, ciprofloxacin, gentamicin).</p>
<p>If we group on e.g.the <code>genus</code> column and add some additional functions from our package, we can create this:</p>
<divclass="sourceCode"id="cb32"><preclass="sourceCode r"><codeclass="sourceCode r"><aclass="sourceLine"id="cb32-1"title="1"><spanclass="co"># group the data on `genus`</span></a>
<aclass="sourceLine"id="cb32-16"title="16"><spanclass="st"></span><spanclass="kw"><ahref="https://www.rdocumentation.org/packages/ggplot2/topics/labs">labs</a></span>(<spanclass="dt">title =</span><spanclass="st">"Resistance per genus and antibiotic"</span>, </a>
<aclass="sourceLine"id="cb32-16"title="16"><spanclass="st"></span><spanclass="kw"><ahref="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<spanclass="dt">title =</span><spanclass="st">"Resistance per genus and antibiotic"</span>, </a>
<aclass="sourceLine"id="cb32-17"title="17"><spanclass="dt">subtitle =</span><spanclass="st">"(this is fake data)"</span>) <spanclass="op">+</span></a>
<aclass="sourceLine"id="cb32-18"title="18"><spanclass="st"></span><spanclass="co"># and print genus in italic to follow our convention</span></a>
<aclass="sourceLine"id="cb32-19"title="19"><spanclass="st"></span><spanclass="co"># (is now y axis because we turned the plot)</span></a>
<p>To simplify this, we also created the <code><ahref="../reference/ggplot_rsi.html">ggplot_rsi()</a></code> function, which combines almost all above functions:</p>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.7.0.9009</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.7.0.9012</span>
</span>
</div>
@ -306,7 +306,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
<p>These functions are meant to count isolates. Use the <code><ahref='portion.html'>portion</a>_*</code> functions to calculate microbial resistance.</p>
<p>The function <code>n_rsi</code> is an alias of <code>count_all</code>. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to <code><ahref='https://dplyr.tidyverse.org/reference/n_distinct.html'>n_distinct</a></code>. Their function is equal to <code>count_S(...) + count_IR(...)</code>.</p>
<p>The function <code>count_df</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><ahref='as.rsi.html'>as.rsi</a></code>) and counts the amounts of S, I and R. The resulting <em>tidy data</em> (see Source) <code>data.frame</code> will have three rows (S/I/R) and a column for each variable with class <code>"rsi"</code>.</p>
<p>The function <code>rsi_df</code> works exactly like <code>count_df</code>, but add the percentage of S, I and R.</p>
<p>The function <code>rsi_df</code> works exactly like <code>count_df</code>, but adds the percentage of S, I and R.</p>
<h2class="hasAnchor"id="interpretation-of-s-i-and-r"><aclass="anchor"href="#interpretation-of-s-i-and-r"></a>Interpretation of S, I and R</h2>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.7.0.9009</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">0.7.0.9012</span>
</span>
</div>
@ -321,7 +321,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
<p><strong>Remember that you should filter your table to let it contain only first isolates!</strong> Use <code><ahref='first_isolate.html'>first_isolate</a></code> to determine them in your data set.</p>
<p>These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the <code><ahref='count.html'>count</a></code> functions to count isolates. <em>Low counts can infuence the outcome - these <code>portion</code> functions may camouflage this, since they only return the portion albeit being dependent on the <code>minimum</code> parameter.</em></p>
<p>The function <code>portion_df</code> takes any variable from <code>data</code> that has an <code>"rsi"</code> class (created with <code><ahref='as.rsi.html'>as.rsi</a></code>) and calculates the portions R, I and S. The resulting <em>tidy data</em> (see Source) <code>data.frame</code> will have three rows (S/I/R) and a column for each group and each variable with class <code>"rsi"</code>.</p>
<p>The function <code>rsi_df</code> works exactly like <code>portion_df</code>, but add the number of isolates.
<p>The function <code>rsi_df</code> works exactly like <code>portion_df</code>, but adds the number of isolates.
<br/><br/>
To calculate the probability (<em>p</em>) of susceptibility of one antibiotic, we use this formula:
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.