1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 07:26:13 +01:00

(v0.9.0.9002) website updates

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-12-16 11:08:25 +01:00
parent a7e538e562
commit f7eb6e4107
34 changed files with 437 additions and 346 deletions

1
.gitignore vendored
View File

@ -22,3 +22,4 @@ packrat/lib*/
packrat/src/ packrat/src/
data-raw/taxon.tab data-raw/taxon.tab
data-raw/DSMZ_bactnames.xlsx data-raw/DSMZ_bactnames.xlsx
data-raw/country_analysis_url_token.R

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 0.9.0 Version: 0.9.0.9002
Date: 2019-11-30 Date: 2019-12-16
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(
person(role = c("aut", "cre"), person(role = c("aut", "cre"),

View File

@ -1,3 +1,8 @@
# AMR 0.9.0.9002
## <small>Last updated: 16-Dec-2019</small>
Website updates
# AMR 0.9.0 # AMR 0.9.0
### Breaking ### Breaking

View File

@ -0,0 +1,80 @@
# Read and format data ----------------------------------------------------
library(tidyverse)
library(maps)
# get website analytics
source("data-raw/country_analysis_url_token.R")
url_json <- paste0(country_analysis_url,
"/index.php?&module=API&token_auth=",
country_analysis_token,
"&method=Live.getLastVisitsDetails&idSite=3&language=en&expanded=1&date=2018-01-01,2028-01-01&period=range&filter_limit=-1&format=JSON&segment=&translateColumnNames=1")
data_json <- jsonlite::read_json(url_json)
data <- tibble(
timestamp_server = as.POSIXct(sapply(data_json, function(x) x$serverTimestamp), origin = "1970-01-01"),
country = sapply(data_json, function(x) x$country))
# Plot world map ----------------------------------------------------------
countries_name <- sort(unique(data$country))
countries_name <- countries_name[countries_name != "Unknown"]
countries_iso <- countrycode::countrycode(countries_name, 'country.name', 'iso3c')
world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE)) %>%
mutate(countries_code = countrycode::countrycode(ID, 'country.name', 'iso3c'),
included = as.integer(countries_code %in% countries_iso)) %>%
mutate(not_antarctica = as.integer(ID != "Antarctica"))
(ggplot(world1) +
geom_sf(aes(fill = included, colour = not_antarctica), size = 0.25) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.title = element_blank(),
axis.text = element_blank()) +
scale_fill_gradient(low = "white", high = "#CAD6EA") +
# this makes the border Antarctica turn white (invisible):
scale_colour_gradient(low = "white", high = "#81899B") +
geom_text(aes(x = -170,
y = -70,
label = stringr::str_wrap(paste0("Accented countries (n = ",
length(countries_name), "): ",
paste(countries_name, collapse = ", ")),
225)),
hjust = 0,
size = 4)) %>%
ggsave("pkgdown/logos/countries.png", dpi = 300, plot = ., scale = 1.5)
# Gibberish ---------------------------------------------------------------
p1 <- data %>%
group_by(country) %>%
summarise(first = min(timestamp_server)) %>%
arrange(first) %>%
mutate(n = row_number()) %>%
ggplot(aes(x = first, y = n)) +
geom_line() +
geom_point(aes(x = max(first), y = max(n)), size = 3) +
scale_x_datetime(date_breaks = "2 months", date_labels = "%B %Y") +
labs(x = NULL, y = "Number of countries")
package_releases <- read_html("https://cran.r-project.org/src/contrib/Archive/AMR/") %>%
rvest::html_table() %>%
.[[1]] %>%
as_tibble(.name_repair = "unique") %>%
filter(`Last modified` != "") %>%
transmute(version = gsub("[^0-9.]", "",
gsub(".tar.gz", "", Name)),
datetime = as.POSIXct(`Last modified`)) %>%
# add current
bind_rows(tibble(version = as.character(packageVersion("AMR")),
datetime = as.POSIXct(packageDate("AMR")))) %>%
# remove the ones not plottable
filter(datetime > min(p1$data$first))
p1 + geom_linerange(data = package_releases, aes(x = datetime, ymin = 0, ymax = 80), colour = "red", inherit.aes = FALSE)

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a> <a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

View File

@ -187,7 +187,7 @@
<h1>How to conduct AMR analysis</h1> <h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">30 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div> <div class="hidden name"><code>AMR.Rmd</code></div>
@ -196,7 +196,7 @@
<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 <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 30 November 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 <a href="https://rmarkdown.rstudio.com/">R Markdown</a>. However, the methodology remains unchanged. This page was generated on 11 December 2019.</p>
<div id="introduction" class="section level1"> <div id="introduction" class="section level1">
<h1 class="hasAnchor"> <h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1> <a href="#introduction" class="anchor"></a>Introduction</h1>
@ -212,21 +212,21 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2019-11-30</td> <td align="center">2019-12-11</td>
<td align="center">abcd</td> <td align="center">abcd</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2019-11-30</td> <td align="center">2019-12-11</td>
<td align="center">abcd</td> <td align="center">abcd</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">2019-11-30</td> <td align="center">2019-12-11</td>
<td align="center">efgh</td> <td align="center">efgh</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">R</td> <td align="center">R</td>
@ -321,70 +321,70 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">2017-05-01</td> <td align="center">2017-05-19</td>
<td align="center">L9</td> <td align="center">J2</td>
<td align="center">Hospital A</td> <td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td> <td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2014-02-04</td> <td align="center">2016-07-09</td>
<td align="center">U2</td> <td align="center">K4</td>
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">Escherichia coli</td> <td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2014-05-10</td>
<td align="center">R6</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2011-06-29</td>
<td align="center">T4</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2012-02-11</td>
<td align="center">O10</td>
<td align="center">Hospital A</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">I</td> <td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2016-12-08</td>
<td align="center">P9</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2014-11-30</td> <td align="center">2017-04-09</td>
<td align="center">V1</td> <td align="center">D3</td>
<td align="center">Hospital B</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2017-09-12</td>
<td align="center">T5</td>
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2010-01-31</td>
<td align="center">W3</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td> <td align="center">Escherichia coli</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">S</td>
<td align="center">M</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -406,8 +406,8 @@
# #
# Item Count Percent Cum. Count Cum. Percent # Item Count Percent Cum. Count Cum. Percent
# --- ----- ------- -------- ----------- ------------- # --- ----- ------- -------- ----------- -------------
# 1 M 10,321 51.61% 10,321 51.61% # 1 M 10,408 52.04% 10,408 52.04%
# 2 F 9,679 48.40% 20,000 100.00%</code></pre> # 2 F 9,592 47.96% 20,000 100.00%</code></pre>
<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 didnt already know.</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 didnt 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><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</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><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a> <div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -422,8 +422,8 @@
<a class="sourceLine" id="cb14-3" data-line-number="3"><span class="co"># Other rules by this AMR package</span></a> <a class="sourceLine" id="cb14-3" data-line-number="3"><span class="co"># Other rules by this AMR package</span></a>
<a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a> <a class="sourceLine" id="cb14-4" data-line-number="4"><span class="co"># Non-EUCAST: inherit amoxicillin results for unavailable ampicillin (no changes)</span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5"><span class="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a> <a class="sourceLine" id="cb14-5" data-line-number="5"><span class="co"># Non-EUCAST: inherit ampicillin results for unavailable amoxicillin (no changes)</span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,960 values changed)</span></a> <a class="sourceLine" id="cb14-6" data-line-number="6"><span class="co"># Non-EUCAST: set amoxicillin/clav acid = S where ampicillin = S (2,997 values changed)</span></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (144 values changed)</span></a> <a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co"># Non-EUCAST: set ampicillin = R where amoxicillin/clav acid = R (165 values changed)</span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a> <a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co"># Non-EUCAST: set piperacillin = R where piperacillin/tazobactam = R (no changes)</span></a>
<a class="sourceLine" id="cb14-9" data-line-number="9"><span class="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a> <a class="sourceLine" id="cb14-9" data-line-number="9"><span class="co"># Non-EUCAST: set piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb14-10" data-line-number="10"><span class="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a> <a class="sourceLine" id="cb14-10" data-line-number="10"><span class="co"># Non-EUCAST: set trimethoprim = R where trimethoprim/sulfa = R (no changes)</span></a>
@ -448,14 +448,14 @@
<a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Pasteurella multocida (no changes)</span></a> <a class="sourceLine" id="cb14-29" data-line-number="29"><span class="co"># Pasteurella multocida (no changes)</span></a>
<a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Staphylococcus (no changes)</span></a> <a class="sourceLine" id="cb14-30" data-line-number="30"><span class="co"># Staphylococcus (no changes)</span></a>
<a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a> <a class="sourceLine" id="cb14-31" data-line-number="31"><span class="co"># Streptococcus groups A, B, C, G (no changes)</span></a>
<a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (997 values changed)</span></a> <a class="sourceLine" id="cb14-32" data-line-number="32"><span class="co"># Streptococcus pneumoniae (1,063 values changed)</span></a>
<a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Viridans group streptococci (no changes)</span></a> <a class="sourceLine" id="cb14-33" data-line-number="33"><span class="co"># Viridans group streptococci (no changes)</span></a>
<a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a> <a class="sourceLine" id="cb14-34" data-line-number="34"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a> <a class="sourceLine" id="cb14-35" data-line-number="35"><span class="co"># EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,331 values changed)</span></a> <a class="sourceLine" id="cb14-36" data-line-number="36"><span class="co"># Table 01: Intrinsic resistance in Enterobacteriaceae (1,242 values changed)</span></a>
<a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a> <a class="sourceLine" id="cb14-37" data-line-number="37"><span class="co"># Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a> <a class="sourceLine" id="cb14-38" data-line-number="38"><span class="co"># Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,705 values changed)</span></a> <a class="sourceLine" id="cb14-39" data-line-number="39"><span class="co"># Table 04: Intrinsic resistance in Gram-positive bacteria (2,782 values changed)</span></a>
<a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a> <a class="sourceLine" id="cb14-40" data-line-number="40"><span class="co"># Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a> <a class="sourceLine" id="cb14-41" data-line-number="41"><span class="co"># Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a> <a class="sourceLine" id="cb14-42" data-line-number="42"><span class="co"># Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)</span></a>
@ -463,15 +463,15 @@
<a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a> <a class="sourceLine" id="cb14-44" data-line-number="44"><span class="co"># Table 13: Interpretive rules for quinolones (no changes)</span></a>
<a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># </span></a> <a class="sourceLine" id="cb14-45" data-line-number="45"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># -------------------------------------------------------------------------------</span></a> <a class="sourceLine" id="cb14-46" data-line-number="46"><span class="co"># -------------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,481 out of 20,000 rows, making a total of 8,137 edits</span></a> <a class="sourceLine" id="cb14-47" data-line-number="47"><span class="co"># EUCAST rules affected 6,564 out of 20,000 rows, making a total of 8,249 edits</span></a>
<a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># =&gt; added 0 test results</span></a> <a class="sourceLine" id="cb14-48" data-line-number="48"><span class="co"># =&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># </span></a> <a class="sourceLine" id="cb14-49" data-line-number="49"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># =&gt; changed 8,137 test results</span></a> <a class="sourceLine" id="cb14-50" data-line-number="50"><span class="co"># =&gt; changed 8,249 test results</span></a>
<a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 115 test results changed from S to I</span></a> <a class="sourceLine" id="cb14-51" data-line-number="51"><span class="co"># - 102 test results changed from S to I</span></a>
<a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,732 test results changed from S to R</span></a> <a class="sourceLine" id="cb14-52" data-line-number="52"><span class="co"># - 4,787 test results changed from S to R</span></a>
<a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,228 test results changed from I to S</span></a> <a class="sourceLine" id="cb14-53" data-line-number="53"><span class="co"># - 1,224 test results changed from I to S</span></a>
<a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 330 test results changed from I to R</span></a> <a class="sourceLine" id="cb14-54" data-line-number="54"><span class="co"># - 363 test results changed from I to R</span></a>
<a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,732 test results changed from R to S</span></a> <a class="sourceLine" id="cb14-55" data-line-number="55"><span class="co"># - 1,773 test results changed from R to S</span></a>
<a class="sourceLine" id="cb14-56" data-line-number="56"><span class="co"># -------------------------------------------------------------------------------</span></a> <a class="sourceLine" id="cb14-56" data-line-number="56"><span class="co"># -------------------------------------------------------------------------------</span></a>
<a class="sourceLine" id="cb14-57" data-line-number="57"><span class="co"># </span></a> <a class="sourceLine" id="cb14-57" data-line-number="57"><span class="co"># </span></a>
<a class="sourceLine" id="cb14-58" data-line-number="58"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div> <a class="sourceLine" id="cb14-58" data-line-number="58"><span class="co"># Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.</span></a></code></pre></div>
@ -499,7 +499,7 @@
<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a> <a class="sourceLine" id="cb16-3" data-line-number="3"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a> <a class="sourceLine" id="cb16-4" data-line-number="4"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb16-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a> <a class="sourceLine" id="cb16-5" data-line-number="5"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,667 first isolates (28.3% of total)</span></a></code></pre></div> <a class="sourceLine" id="cb16-6" data-line-number="6"><span class="co"># =&gt; Found 5,656 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><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p> <p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div> <a class="sourceLine" id="cb17-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
@ -510,7 +510,7 @@
<div id="first-weighted-isolates" class="section level2"> <div id="first-weighted-isolates" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2> <a href="#first-weighted-isolates" class="anchor"></a>First <em>weighted</em> isolates</h2>
<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 E9, 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 D2, sorted on date:</p>
<table class="table"> <table class="table">
<thead><tr class="header"> <thead><tr class="header">
<th align="center">isolate</th> <th align="center">isolate</th>
@ -526,52 +526,52 @@
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">1</td> <td align="center">1</td>
<td align="center">2010-07-16</td> <td align="center">2010-02-23</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2</td> <td align="center">2</td>
<td align="center">2010-07-22</td> <td align="center">2010-03-20</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">3</td> <td align="center">3</td>
<td align="center">2010-08-26</td> <td align="center">2010-04-13</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">4</td> <td align="center">4</td>
<td align="center">2010-10-17</td> <td align="center">2010-07-22</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">5</td> <td align="center">5</td>
<td align="center">2010-10-25</td> <td align="center">2010-07-22</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -581,10 +581,10 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">6</td> <td align="center">6</td>
<td align="center">2011-02-27</td> <td align="center">2010-08-04</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -592,8 +592,8 @@
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">7</td> <td align="center">7</td>
<td align="center">2011-03-15</td> <td align="center">2010-08-19</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
@ -603,40 +603,40 @@
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">8</td> <td align="center">8</td>
<td align="center">2011-03-19</td> <td align="center">2010-09-02</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">9</td> <td align="center">9</td>
<td align="center">2011-06-20</td> <td align="center">2010-09-04</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">10</td> <td align="center">10</td>
<td align="center">2011-12-03</td> <td align="center">2010-09-18</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>Only 2 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><a href="../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><a href="../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><a href="../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> <p>If a column exists with a name like key(…)ab the <code><a href="../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>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb19-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">keyab =</span> <span class="kw"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(.)) <span class="op">%&gt;%</span><span class="st"> </span></a> <a class="sourceLine" id="cb19-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">keyab =</span> <span class="kw"><a href="../reference/key_antibiotics.html">key_antibiotics</a></span>(.)) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -647,7 +647,7 @@
<a class="sourceLine" id="cb19-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a> <a class="sourceLine" id="cb19-7" data-line-number="7"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb19-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a> <a class="sourceLine" id="cb19-8" data-line-number="8"><span class="co"># </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a> <a class="sourceLine" id="cb19-9" data-line-number="9"><span class="co"># [Criterion] Inclusion based on key antibiotics, ignoring I</span></a>
<a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,044 first weighted isolates (75.2% of total)</span></a></code></pre></div> <a class="sourceLine" id="cb19-10" data-line-number="10"><span class="co"># =&gt; Found 15,026 first weighted isolates (75.1% of total)</span></a></code></pre></div>
<table class="table"> <table class="table">
<thead><tr class="header"> <thead><tr class="header">
<th align="center">isolate</th> <th align="center">isolate</th>
@ -664,131 +664,131 @@
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">1</td> <td align="center">1</td>
<td align="center">2010-07-16</td> <td align="center">2010-02-23</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">2</td> <td align="center">2</td>
<td align="center">2010-07-22</td> <td align="center">2010-03-20</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">3</td> <td align="center">3</td>
<td align="center">2010-08-26</td> <td align="center">2010-04-13</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">4</td> <td align="center">4</td>
<td align="center">2010-10-17</td> <td align="center">2010-07-22</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">5</td> <td align="center">5</td>
<td align="center">2010-10-25</td> <td align="center">2010-07-22</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">FALSE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">6</td> <td align="center">6</td>
<td align="center">2011-02-27</td> <td align="center">2010-08-04</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">FALSE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">7</td> <td align="center">7</td>
<td align="center">2011-03-15</td> <td align="center">2010-08-19</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">FALSE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">8</td> <td align="center">8</td>
<td align="center">2011-03-19</td> <td align="center">2010-09-02</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">9</td> <td align="center">9</td>
<td align="center">2011-06-20</td> <td align="center">2010-09-04</td>
<td align="center">E9</td> <td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2010-09-18</td>
<td align="center">D2</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">FALSE</td> <td align="center">FALSE</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-12-03</td>
<td align="center">E9</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
</tbody> </tbody>
</table> </table>
<p>Instead of 2, now 7 isolates are flagged. In total, 75.2% of all isolates are marked first weighted - 46.9% 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 9 isolates are flagged. In total, 75.1% of all isolates are marked first weighted - 46.9% 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><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p> <p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div> <a class="sourceLine" id="cb20-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 15,044 isolates for analysis.</p> <p>So we end up with 15,026 isolates for analysis.</p>
<p>We can remove unneeded columns:</p> <p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div> <a class="sourceLine" id="cb21-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://rdrr.io/r/base/c.html">c</a></span>(first, keyab))</a></code></pre></div>
@ -796,7 +796,6 @@
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(data_1st)</a></code></pre></div> <div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(data_1st)</a></code></pre></div>
<table class="table"> <table class="table">
<thead><tr class="header"> <thead><tr class="header">
<th></th>
<th align="center">date</th> <th align="center">date</th>
<th align="center">patient_id</th> <th align="center">patient_id</th>
<th align="center">hospital</th> <th align="center">hospital</th>
@ -813,62 +812,58 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td>3</td> <td align="center">2017-05-19</td>
<td align="center">2016-12-08</td> <td align="center">J2</td>
<td align="center">P9</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>4</td>
<td align="center">2014-11-30</td>
<td align="center">V1</td>
<td align="center">Hospital B</td>
<td align="center">B_KLBSL_PNMN</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>5</td>
<td align="center">2017-09-12</td>
<td align="center">T5</td>
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">B_STPHY_AURS</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">F</td> <td align="center">R</td>
<td align="center">Gram-positive</td> <td align="center">S</td>
<td align="center">Staphylococcus</td> <td align="center">S</td>
<td align="center">aureus</td> <td align="center">M</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td>6</td> <td align="center">2016-07-09</td>
<td align="center">2010-01-31</td> <td align="center">K4</td>
<td align="center">W3</td>
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">B_STRPT_PNMN</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram-positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">2014-05-10</td>
<td align="center">R6</td>
<td align="center">Hospital C</td>
<td align="center">B_ESCHR_COLI</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram-negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2011-06-29</td>
<td align="center">T4</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COLI</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">F</td> <td align="center">F</td>
<td align="center">Gram-negative</td> <td align="center">Gram-negative</td>
@ -877,35 +872,33 @@
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td>7</td> <td align="center">2012-02-11</td>
<td align="center">2015-09-28</td> <td align="center">O10</td>
<td align="center">K4</td> <td align="center">Hospital A</td>
<td align="center">Hospital B</td> <td align="center">B_STRPT_PNMN</td>
<td align="center">B_KLBSL_PNMN</td> <td align="center">I</td>
<td align="center">I</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">F</td>
<td align="center">M</td> <td align="center">Gram-positive</td>
<td align="center">Gram-negative</td> <td align="center">Streptococcus</td>
<td align="center">Klebsiella</td>
<td align="center">pneumoniae</td> <td align="center">pneumoniae</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td>8</td> <td align="center">2017-04-09</td>
<td align="center">2011-08-30</td> <td align="center">D3</td>
<td align="center">B6</td> <td align="center">Hospital D</td>
<td align="center">Hospital A</td> <td align="center">B_ESCHR_COLI</td>
<td align="center">B_STPHY_AURS</td> <td align="center">R</td>
<td align="center">S</td> <td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">S</td> <td align="center">S</td>
<td align="center">M</td> <td align="center">M</td>
<td align="center">Gram-positive</td> <td align="center">Gram-negative</td>
<td align="center">Staphylococcus</td> <td align="center">Escherichia</td>
<td align="center">aureus</td> <td align="center">coli</td>
<td align="center">TRUE</td> <td align="center">TRUE</td>
</tr> </tr>
</tbody> </tbody>
@ -927,7 +920,7 @@
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div> <div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table</strong></p> <p><strong>Frequency table</strong></p>
<p>Class: character<br> <p>Class: character<br>
Length: 15,044 (of which NA: 0 = 0%)<br> Length: 15,026 (of which NA: 0 = 0%)<br>
Unique: 4</p> Unique: 4</p>
<p>Shortest: 16<br> <p>Shortest: 16<br>
Longest: 24</p> Longest: 24</p>
@ -944,33 +937,33 @@ Longest: 24</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">Escherichia coli</td> <td align="left">Escherichia coli</td>
<td align="right">7,493</td> <td align="right">7,425</td>
<td align="right">49.81%</td> <td align="right">49.41%</td>
<td align="right">7,493</td> <td align="right">7,425</td>
<td align="right">49.81%</td> <td align="right">49.41%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">Staphylococcus aureus</td> <td align="left">Staphylococcus aureus</td>
<td align="right">3,718</td> <td align="right">3,806</td>
<td align="right">24.71%</td> <td align="right">25.33%</td>
<td align="right">11,211</td> <td align="right">11,231</td>
<td align="right">74.52%</td> <td align="right">74.74%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td> <td align="left">Streptococcus pneumoniae</td>
<td align="right">2,293</td> <td align="right">2,311</td>
<td align="right">15.24%</td> <td align="right">15.38%</td>
<td align="right">13,504</td> <td align="right">13,542</td>
<td align="right">89.76%</td> <td align="right">90.12%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">4</td> <td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td> <td align="left">Klebsiella pneumoniae</td>
<td align="right">1,540</td> <td align="right">1,484</td>
<td align="right">10.24%</td> <td align="right">9.88%</td>
<td align="right">15,044</td> <td align="right">15,026</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>
</tbody> </tbody>
@ -982,7 +975,7 @@ Longest: 24</p>
<p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p> <p>The functions <code><a href="../reference/proportion.html">resistance()</a></code> and <code><a href="../reference/proportion.html">susceptibility()</a></code> can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions <code><a href="../reference/proportion.html">proportion_S()</a></code>, <code><a href="../reference/proportion.html">proportion_SI()</a></code>, <code><a href="../reference/proportion.html">proportion_I()</a></code>, <code><a href="../reference/proportion.html">proportion_IR()</a></code> and <code><a href="../reference/proportion.html">proportion_R()</a></code> can be used to determine the proportion of a specific antimicrobial outcome.</p>
<p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p> <p>As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (<code><a href="../reference/proportion.html">proportion_R()</a></code>, equal to <code><a href="../reference/proportion.html">resistance()</a></code>) and susceptibility as the proportion of S and I (<code><a href="../reference/proportion.html">proportion_SI()</a></code>, equal to <code><a href="../reference/proportion.html">susceptibility()</a></code>). These functions can be used on their own:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX)</a> <div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/proportion.html">resistance</a></span>(AMX)</a>
<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4660994</span></a></code></pre></div> <a class="sourceLine" id="cb25-2" data-line-number="2"><span class="co"># [1] 0.4631971</span></a></code></pre></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p> <p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a> <div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a> <a class="sourceLine" id="cb26-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -995,19 +988,19 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.4644833</td> <td align="center">0.4553786</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.4626231</td> <td align="center">0.4653638</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.4616060</td> <td align="center">0.4613043</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.4776800</td> <td align="center">0.4729412</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1025,23 +1018,23 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital A</td> <td align="center">Hospital A</td>
<td align="center">0.4644833</td> <td align="center">0.4553786</td>
<td align="center">4519</td> <td align="center">4583</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital B</td> <td align="center">Hospital B</td>
<td align="center">0.4626231</td> <td align="center">0.4653638</td>
<td align="center">5177</td> <td align="center">5168</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Hospital C</td> <td align="center">Hospital C</td>
<td align="center">0.4616060</td> <td align="center">0.4613043</td>
<td align="center">2279</td> <td align="center">2300</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Hospital D</td> <td align="center">Hospital D</td>
<td align="center">0.4776800</td> <td align="center">0.4729412</td>
<td align="center">3069</td> <td align="center">2975</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -1061,27 +1054,27 @@ Longest: 24</p>
<tbody> <tbody>
<tr class="odd"> <tr class="odd">
<td align="center">Escherichia</td> <td align="center">Escherichia</td>
<td align="center">0.9253970</td> <td align="center">0.9248485</td>
<td align="center">0.8955025</td> <td align="center">0.8921212</td>
<td align="center">0.9929267</td> <td align="center">0.9936700</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Klebsiella</td> <td align="center">Klebsiella</td>
<td align="center">0.9298701</td> <td align="center">0.9238544</td>
<td align="center">0.9038961</td> <td align="center">0.8928571</td>
<td align="center">0.9967532</td> <td align="center">0.9946092</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="center">Staphylococcus</td> <td align="center">Staphylococcus</td>
<td align="center">0.9276493</td> <td align="center">0.9224908</td>
<td align="center">0.9133943</td> <td align="center">0.9177614</td>
<td align="center">0.9943518</td> <td align="center">0.9923805</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="center">Streptococcus</td> <td align="center">Streptococcus</td>
<td align="center">0.6096816</td> <td align="center">0.5962787</td>
<td align="center">0.0000000</td> <td align="center">0.0000000</td>
<td align="center">0.6096816</td> <td align="center">0.5962787</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -187,7 +187,7 @@
<h1>How to apply EUCAST rules</h1> <h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">29 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div> <div class="hidden name"><code>EUCAST.Rmd</code></div>

View File

@ -187,7 +187,7 @@
<h1>How to determine multi-drug resistance (MDR)</h1> <h1>How to determine multi-drug resistance (MDR)</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">29 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>MDR.Rmd</code></div> <div class="hidden name"><code>MDR.Rmd</code></div>
@ -306,19 +306,19 @@ Unique: 2</p>
<p>The data set now looks like this:</p> <p>The data set now looks like this:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(my_TB_data)</a> <div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/head.html">head</a></span>(my_TB_data)</a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></a> <a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co"># rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># 1 S S I R R S</span></a> <a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co"># 1 R R R R S S</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co"># 2 S S R R I S</span></a> <a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co"># 2 S S S S R R</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co"># 3 S S S I R I</span></a> <a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co"># 3 S S S I R I</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># 4 R R S R R S</span></a> <a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># 4 S R I S S S</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># 5 R R S R I S</span></a> <a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># 5 R I S S S R</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># 6 R R R R S R</span></a> <a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># 6 R R R R R I</span></a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># kanamycin</span></a> <a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># kanamycin</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># 1 S</span></a> <a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># 1 S</span></a>
<a class="sourceLine" id="cb5-11" data-line-number="11"><span class="co"># 2 I</span></a> <a class="sourceLine" id="cb5-11" data-line-number="11"><span class="co"># 2 S</span></a>
<a class="sourceLine" id="cb5-12" data-line-number="12"><span class="co"># 3 I</span></a> <a class="sourceLine" id="cb5-12" data-line-number="12"><span class="co"># 3 S</span></a>
<a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co"># 4 R</span></a> <a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co"># 4 I</span></a>
<a class="sourceLine" id="cb5-14" data-line-number="14"><span class="co"># 5 R</span></a> <a class="sourceLine" id="cb5-14" data-line-number="14"><span class="co"># 5 S</span></a>
<a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co"># 6 S</span></a></code></pre></div> <a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co"># 6 I</span></a></code></pre></div>
<p>We can now add the interpretation of MDR-TB to our data set. You can use:</p> <p>We can now add the interpretation of MDR-TB to our data set. You can use:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/mdro.html">mdro</a></span>(my_TB_data, <span class="dt">guideline =</span> <span class="st">"TB"</span>)</a></code></pre></div> <div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/mdro.html">mdro</a></span>(my_TB_data, <span class="dt">guideline =</span> <span class="st">"TB"</span>)</a></code></pre></div>
<p>or its shortcut <code><a href="../reference/mdro.html">mdr_tb()</a></code>:</p> <p>or its shortcut <code><a href="../reference/mdro.html">mdr_tb()</a></code>:</p>
@ -335,7 +335,7 @@ Unique: 2</p>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># Author: WHO (World Health Organization)</span></a> <a class="sourceLine" id="cb7-11" data-line-number="11"><span class="co"># Author: WHO (World Health Organization)</span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/</span></a> <a class="sourceLine" id="cb7-12" data-line-number="12"><span class="co"># Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/</span></a>
<a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># </span></a> <a class="sourceLine" id="cb7-13" data-line-number="13"><span class="co"># </span></a>
<a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># =&gt; Found 4377 MDROs out of 5000 tested isolates (87.5%)</span></a></code></pre></div> <a class="sourceLine" id="cb7-14" data-line-number="14"><span class="co"># =&gt; Found 4374 MDROs out of 5000 tested isolates (87.5%)</span></a></code></pre></div>
<p>Create a frequency table of the results:</p> <p>Create a frequency table of the results:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(my_TB_data<span class="op">$</span>mdr)</a></code></pre></div> <div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/pkg/cleaner/man/freq.html">freq</a></span>(my_TB_data<span class="op">$</span>mdr)</a></code></pre></div>
<p><strong>Frequency table</strong></p> <p><strong>Frequency table</strong></p>
@ -356,40 +356,40 @@ Unique: 5</p>
<tr class="odd"> <tr class="odd">
<td align="left">1</td> <td align="left">1</td>
<td align="left">Mono-resistant</td> <td align="left">Mono-resistant</td>
<td align="right">3240</td> <td align="right">3299</td>
<td align="right">64.80%</td> <td align="right">65.98%</td>
<td align="right">3240</td> <td align="right">3299</td>
<td align="right">64.80%</td> <td align="right">65.98%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">2</td> <td align="left">2</td>
<td align="left">Multi-drug-resistant</td> <td align="left">Negative</td>
<td align="right">647</td> <td align="right">626</td>
<td align="right">12.94%</td> <td align="right">12.52%</td>
<td align="right">3887</td> <td align="right">3925</td>
<td align="right">77.74%</td> <td align="right">78.50%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">3</td> <td align="left">3</td>
<td align="left">Negative</td> <td align="left">Multi-drug-resistant</td>
<td align="right">623</td> <td align="right">572</td>
<td align="right">12.46%</td> <td align="right">11.44%</td>
<td align="right">4510</td> <td align="right">4497</td>
<td align="right">90.20%</td> <td align="right">89.94%</td>
</tr> </tr>
<tr class="even"> <tr class="even">
<td align="left">4</td> <td align="left">4</td>
<td align="left">Poly-resistant</td> <td align="left">Poly-resistant</td>
<td align="right">304</td> <td align="right">265</td>
<td align="right">6.08%</td> <td align="right">5.30%</td>
<td align="right">4814</td> <td align="right">4762</td>
<td align="right">96.28%</td> <td align="right">95.24%</td>
</tr> </tr>
<tr class="odd"> <tr class="odd">
<td align="left">5</td> <td align="left">5</td>
<td align="left">Extensively drug-resistant</td> <td align="left">Extensively drug-resistant</td>
<td align="right">186</td> <td align="right">238</td>
<td align="right">3.72%</td> <td align="right">4.76%</td>
<td align="right">5000</td> <td align="right">5000</td>
<td align="right">100.00%</td> <td align="right">100.00%</td>
</tr> </tr>

View File

@ -187,7 +187,7 @@
<h1>How to import data from SPSS / SAS / Stata</h1> <h1>How to import data from SPSS / SAS / Stata</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">29 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>SPSS.Rmd</code></div> <div class="hidden name"><code>SPSS.Rmd</code></div>

View File

@ -187,7 +187,7 @@
<h1>How to work with WHONET data</h1> <h1>How to work with WHONET data</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">30 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>WHONET.Rmd</code></div> <div class="hidden name"><code>WHONET.Rmd</code></div>

View File

@ -187,7 +187,7 @@
<h1>Benchmarks</h1> <h1>Benchmarks</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">29 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>benchmarks.Rmd</code></div> <div class="hidden name"><code>benchmarks.Rmd</code></div>
@ -222,20 +222,20 @@
<a class="sourceLine" id="cb2-17" data-line-number="17"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a> <a class="sourceLine" id="cb2-17" data-line-number="17"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">2</span>)</a>
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb2-18" data-line-number="18"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-19" data-line-number="19"><span class="co"># expr min lq mean median uq max neval</span></a> <a class="sourceLine" id="cb2-19" data-line-number="19"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-20" data-line-number="20"><span class="co"># as.mo("sau") 11 11 15 12 14 39 10</span></a> <a class="sourceLine" id="cb2-20" data-line-number="20"><span class="co"># as.mo("sau") 11 11 15 11 14 33 10</span></a>
<a class="sourceLine" id="cb2-21" data-line-number="21"><span class="co"># as.mo("stau") 36 38 49 48 60 65 10</span></a> <a class="sourceLine" id="cb2-21" data-line-number="21"><span class="co"># as.mo("stau") 34 38 47 43 58 65 10</span></a>
<a class="sourceLine" id="cb2-22" data-line-number="22"><span class="co"># as.mo("STAU") 36 38 46 40 59 71 10</span></a> <a class="sourceLine" id="cb2-22" data-line-number="22"><span class="co"># as.mo("STAU") 34 37 45 39 59 65 10</span></a>
<a class="sourceLine" id="cb2-23" data-line-number="23"><span class="co"># as.mo("staaur") 11 11 21 11 37 37 10</span></a> <a class="sourceLine" id="cb2-23" data-line-number="23"><span class="co"># as.mo("staaur") 10 12 30 12 37 120 10</span></a>
<a class="sourceLine" id="cb2-24" data-line-number="24"><span class="co"># as.mo("STAAUR") 11 11 12 12 12 17 10</span></a> <a class="sourceLine" id="cb2-24" data-line-number="24"><span class="co"># as.mo("STAAUR") 11 11 20 12 34 45 10</span></a>
<a class="sourceLine" id="cb2-25" data-line-number="25"><span class="co"># as.mo("S. aureus") 26 29 36 32 48 53 10</span></a> <a class="sourceLine" id="cb2-25" data-line-number="25"><span class="co"># as.mo("S. aureus") 26 27 34 30 34 54 10</span></a>
<a class="sourceLine" id="cb2-26" data-line-number="26"><span class="co"># as.mo("S aureus") 25 27 37 29 52 64 10</span></a> <a class="sourceLine" id="cb2-26" data-line-number="26"><span class="co"># as.mo("S aureus") 26 27 44 28 28 160 10</span></a>
<a class="sourceLine" id="cb2-27" data-line-number="27"><span class="co"># as.mo("Staphylococcus aureus") 33 34 39 36 45 53 10</span></a> <a class="sourceLine" id="cb2-27" data-line-number="27"><span class="co"># as.mo("Staphylococcus aureus") 32 34 37 35 41 44 10</span></a>
<a class="sourceLine" id="cb2-28" data-line-number="28"><span class="co"># as.mo("Staphylococcus aureus (MRSA)") 660 720 740 740 760 800 10</span></a> <a class="sourceLine" id="cb2-28" data-line-number="28"><span class="co"># as.mo("Staphylococcus aureus (MRSA)") 640 690 710 700 720 810 10</span></a>
<a class="sourceLine" id="cb2-29" data-line-number="29"><span class="co"># as.mo("Sthafilokkockus aaureuz") 350 360 410 380 400 660 10</span></a> <a class="sourceLine" id="cb2-29" data-line-number="29"><span class="co"># as.mo("Sthafilokkockus aaureuz") 340 370 390 380 400 470 10</span></a>
<a class="sourceLine" id="cb2-30" data-line-number="30"><span class="co"># as.mo("MRSA") 11 11 14 12 12 36 10</span></a> <a class="sourceLine" id="cb2-30" data-line-number="30"><span class="co"># as.mo("MRSA") 11 11 14 12 12 35 10</span></a>
<a class="sourceLine" id="cb2-31" data-line-number="31"><span class="co"># as.mo("VISA") 21 23 27 26 28 47 10</span></a> <a class="sourceLine" id="cb2-31" data-line-number="31"><span class="co"># as.mo("VISA") 22 23 33 26 46 51 10</span></a>
<a class="sourceLine" id="cb2-32" data-line-number="32"><span class="co"># as.mo("VRSA") 21 22 30 23 44 52 10</span></a> <a class="sourceLine" id="cb2-32" data-line-number="32"><span class="co"># as.mo("VRSA") 20 22 25 24 26 43 10</span></a>
<a class="sourceLine" id="cb2-33" data-line-number="33"><span class="co"># as.mo(22242419) 20 20 24 21 21 52 10</span></a></code></pre></div> <a class="sourceLine" id="cb2-33" data-line-number="33"><span class="co"># as.mo(22242419) 20 25 37 36 49 55 10</span></a></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-5-1.png" width="562.5"></p> <p><img src="benchmarks_files/figure-html/unnamed-chunk-5-1.png" width="562.5"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</p> <p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Methanosarcina semesiae</em> (<code>B_MTHNSR_SEMS</code>), a bug probably never found before in humans:</p> <p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of <em>Methanosarcina semesiae</em> (<code>B_MTHNSR_SEMS</code>), a bug probably never found before in humans:</p>
@ -247,19 +247,19 @@
<a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">times =</span> <span class="dv">10</span>)</a> <a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(M.semesiae, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a> <a class="sourceLine" id="cb3-7" data-line-number="7"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(M.semesiae, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb3-8" data-line-number="8"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># expr min lq mean median uq max</span></a> <a class="sourceLine" id="cb3-9" data-line-number="9"><span class="co"># expr min lq mean median uq max</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("metsem") 1501.0 1506.00 1665.0 1569.00 1788.00 2141.00</span></a> <a class="sourceLine" id="cb3-10" data-line-number="10"><span class="co"># as.mo("metsem") 1455.00 1534.00 1589.00 1546.00 1642.0 1856.0</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("METSEM") 1586.0 1610.00 1727.0 1675.00 1793.00 2002.00</span></a> <a class="sourceLine" id="cb3-11" data-line-number="11"><span class="co"># as.mo("METSEM") 1504.00 1560.00 1570.00 1568.00 1581.0 1668.0</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("M. semesiae") 2266.0 2335.00 2587.0 2418.00 2524.00 3676.00</span></a> <a class="sourceLine" id="cb3-12" data-line-number="12"><span class="co"># as.mo("M. semesiae") 2262.00 2295.00 2338.00 2321.00 2361.0 2536.0</span></a>
<a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("M. semesiae") 2143.0 2252.00 2334.0 2331.00 2396.00 2540.00</span></a> <a class="sourceLine" id="cb3-13" data-line-number="13"><span class="co"># as.mo("M. semesiae") 2243.00 2261.00 2304.00 2302.00 2334.0 2397.0</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Methanosarcina semesiae") 34.8 35.74 46.3 39.64 62.28 65.83</span></a> <a class="sourceLine" id="cb3-14" data-line-number="14"><span class="co"># as.mo("Methanosarcina semesiae") 33.36 35.01 43.82 39.71 47.8 68.4</span></a>
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># neval</span></a> <a class="sourceLine" id="cb3-15" data-line-number="15"><span class="co"># neval</span></a>
<a class="sourceLine" id="cb3-16" data-line-number="16"><span class="co"># 10</span></a> <a class="sourceLine" id="cb3-16" data-line-number="16"><span class="co"># 10</span></a>
<a class="sourceLine" id="cb3-17" data-line-number="17"><span class="co"># 10</span></a> <a class="sourceLine" id="cb3-17" data-line-number="17"><span class="co"># 10</span></a>
<a class="sourceLine" id="cb3-18" data-line-number="18"><span class="co"># 10</span></a> <a class="sourceLine" id="cb3-18" data-line-number="18"><span class="co"># 10</span></a>
<a class="sourceLine" id="cb3-19" data-line-number="19"><span class="co"># 10</span></a> <a class="sourceLine" id="cb3-19" data-line-number="19"><span class="co"># 10</span></a>
<a class="sourceLine" id="cb3-20" data-line-number="20"><span class="co"># 10</span></a></code></pre></div> <a class="sourceLine" id="cb3-20" data-line-number="20"><span class="co"># 10</span></a></code></pre></div>
<p>That takes 15.6 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like <em>Methanosarcina semesiae</em>) are almost fast - these are the most probable input from most data sets.</p> <p>That takes 14.9 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like <em>Methanosarcina semesiae</em>) are almost fast - these are the most probable input from most data sets.</p>
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Methanosarcina semesiae</em> (which is uncommon):</p> <p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Methanosarcina semesiae</em> (which is uncommon):</p>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-9-1.png" width="562.5"></p> <p><img src="benchmarks_files/figure-html/unnamed-chunk-9-1.png" width="562.5"></p>
<p>In reality, the <code><a href="../reference/as.mo.html">as.mo()</a></code> functions <strong>learns from its own output to speed up determinations for next times</strong>. In above figure, this effect was disabled to show the difference with the boxplot below - when you would use <code><a href="../reference/as.mo.html">as.mo()</a></code> yourself:</p> <p>In reality, the <code><a href="../reference/as.mo.html">as.mo()</a></code> functions <strong>learns from its own output to speed up determinations for next times</strong>. In above figure, this effect was disabled to show the difference with the boxplot below - when you would use <code><a href="../reference/as.mo.html">as.mo()</a></code> yourself:</p>
@ -296,8 +296,8 @@
<a class="sourceLine" id="cb4-24" data-line-number="24"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a> <a class="sourceLine" id="cb4-24" data-line-number="24"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb4-25" data-line-number="25"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb4-25" data-line-number="25"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb4-26" data-line-number="26"><span class="co"># expr min lq mean median uq max neval</span></a> <a class="sourceLine" id="cb4-26" data-line-number="26"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb4-27" data-line-number="27"><span class="co"># mo_name(x) 655 668 715 717 751 797 10</span></a></code></pre></div> <a class="sourceLine" id="cb4-27" data-line-number="27"><span class="co"># mo_name(x) 647 669 689 685 701 770 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.72 seconds (717 ms). You only lose time on your unique input values.</p> <p>So transforming 500,000 values (!!) of 50 unique values only takes 0.69 seconds (685 ms). You only lose time on your unique input values.</p>
</div> </div>
<div id="precalculated-results" class="section level3"> <div id="precalculated-results" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
@ -309,11 +309,11 @@
<a class="sourceLine" id="cb5-4" data-line-number="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a> <a class="sourceLine" id="cb5-4" data-line-number="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a> <a class="sourceLine" id="cb5-5" data-line-number="5"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a> <a class="sourceLine" id="cb5-7" data-line-number="7"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># A 6.70 6.710 9.690 7.18 7.850 31.90 10</span></a> <a class="sourceLine" id="cb5-8" data-line-number="8"><span class="co"># A 6.440 6.560 11.00 7.210 8.75 44.10 10</span></a>
<a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># B 26.20 27.100 32.400 28.80 32.100 58.80 10</span></a> <a class="sourceLine" id="cb5-9" data-line-number="9"><span class="co"># B 25.400 25.700 31.40 27.900 34.90 53.80 10</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># C 0.78 0.837 0.924 0.88 0.965 1.24 10</span></a></code></pre></div> <a class="sourceLine" id="cb5-10" data-line-number="10"><span class="co"># C 0.816 0.878 1.05 0.991 1.24 1.37 10</span></a></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0009 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p> <p>So going from <code><a href="../reference/mo_property.html">mo_name("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.001 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a> <div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a> <a class="sourceLine" id="cb6-2" data-line-number="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
<a class="sourceLine" id="cb6-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a> <a class="sourceLine" id="cb6-3" data-line-number="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_name</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
@ -326,14 +326,14 @@
<a class="sourceLine" id="cb6-10" data-line-number="10"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a> <a class="sourceLine" id="cb6-10" data-line-number="10"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb6-11" data-line-number="11"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb6-11" data-line-number="11"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-12" data-line-number="12"><span class="co"># expr min lq mean median uq max neval</span></a> <a class="sourceLine" id="cb6-12" data-line-number="12"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-13" data-line-number="13"><span class="co"># A 0.444 0.449 0.473 0.460 0.466 0.630 10</span></a> <a class="sourceLine" id="cb6-13" data-line-number="13"><span class="co"># A 0.461 0.485 0.613 0.608 0.739 0.775 10</span></a>
<a class="sourceLine" id="cb6-14" data-line-number="14"><span class="co"># B 0.483 0.496 0.511 0.505 0.535 0.539 10</span></a> <a class="sourceLine" id="cb6-14" data-line-number="14"><span class="co"># B 0.505 0.521 0.641 0.552 0.594 1.120 10</span></a>
<a class="sourceLine" id="cb6-15" data-line-number="15"><span class="co"># C 0.709 0.839 0.850 0.846 0.886 0.921 10</span></a> <a class="sourceLine" id="cb6-15" data-line-number="15"><span class="co"># C 0.759 0.846 1.040 0.870 1.270 1.680 10</span></a>
<a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"># D 0.463 0.483 0.521 0.499 0.548 0.694 10</span></a> <a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"># D 0.495 0.502 0.536 0.505 0.532 0.667 10</span></a>
<a class="sourceLine" id="cb6-17" data-line-number="17"><span class="co"># E 0.433 0.451 0.493 0.484 0.513 0.611 10</span></a> <a class="sourceLine" id="cb6-17" data-line-number="17"><span class="co"># E 0.459 0.470 0.549 0.478 0.510 0.830 10</span></a>
<a class="sourceLine" id="cb6-18" data-line-number="18"><span class="co"># F 0.434 0.450 0.481 0.458 0.484 0.582 10</span></a> <a class="sourceLine" id="cb6-18" data-line-number="18"><span class="co"># F 0.457 0.460 0.545 0.469 0.615 0.788 10</span></a>
<a class="sourceLine" id="cb6-19" data-line-number="19"><span class="co"># G 0.434 0.443 0.471 0.455 0.489 0.577 10</span></a> <a class="sourceLine" id="cb6-19" data-line-number="19"><span class="co"># G 0.455 0.474 0.572 0.516 0.694 0.830 10</span></a>
<a class="sourceLine" id="cb6-20" data-line-number="20"><span class="co"># H 0.434 0.436 0.471 0.451 0.480 0.614 10</span></a></code></pre></div> <a class="sourceLine" id="cb6-20" data-line-number="20"><span class="co"># H 0.457 0.466 0.551 0.472 0.545 1.030 10</span></a></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p> <p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div> </div>
<div id="results-in-other-languages" class="section level3"> <div id="results-in-other-languages" class="section level3">
@ -360,13 +360,13 @@
<a class="sourceLine" id="cb7-18" data-line-number="18"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a> <a class="sourceLine" id="cb7-18" data-line-number="18"><span class="kw"><a href="https://rdrr.io/r/base/print.html">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># Unit: milliseconds</span></a> <a class="sourceLine" id="cb7-19" data-line-number="19"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a> <a class="sourceLine" id="cb7-20" data-line-number="20"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># en 22.05 22.65 29.93 25.35 27.03 53.36 10</span></a> <a class="sourceLine" id="cb7-21" data-line-number="21"><span class="co"># en 20.61 21.92 22.93 22.53 24.17 26.26 10</span></a>
<a class="sourceLine" id="cb7-22" data-line-number="22"><span class="co"># de 22.86 23.16 30.45 27.22 28.33 62.68 10</span></a> <a class="sourceLine" id="cb7-22" data-line-number="22"><span class="co"># de 22.19 22.61 28.83 23.28 28.22 51.89 10</span></a>
<a class="sourceLine" id="cb7-23" data-line-number="23"><span class="co"># nl 28.99 29.69 34.37 30.32 31.78 65.15 10</span></a> <a class="sourceLine" id="cb7-23" data-line-number="23"><span class="co"># nl 27.45 28.26 29.07 29.34 29.78 30.03 10</span></a>
<a class="sourceLine" id="cb7-24" data-line-number="24"><span class="co"># es 22.45 23.17 30.84 23.73 28.02 64.67 10</span></a> <a class="sourceLine" id="cb7-24" data-line-number="24"><span class="co"># es 22.05 23.69 30.82 28.10 30.51 51.22 10</span></a>
<a class="sourceLine" id="cb7-25" data-line-number="25"><span class="co"># it 22.76 24.59 30.36 26.23 29.97 66.70 10</span></a> <a class="sourceLine" id="cb7-25" data-line-number="25"><span class="co"># it 23.00 24.39 31.27 27.07 33.34 49.78 10</span></a>
<a class="sourceLine" id="cb7-26" data-line-number="26"><span class="co"># fr 23.00 24.20 30.70 27.00 29.22 51.23 10</span></a> <a class="sourceLine" id="cb7-26" data-line-number="26"><span class="co"># fr 22.13 23.03 26.94 23.83 25.55 52.39 10</span></a>
<a class="sourceLine" id="cb7-27" data-line-number="27"><span class="co"># pt 23.31 24.41 26.92 27.31 28.39 31.00 10</span></a></code></pre></div> <a class="sourceLine" id="cb7-27" data-line-number="27"><span class="co"># pt 22.43 24.94 33.02 28.38 45.69 49.11 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p> <p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div> </div>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

View File

@ -187,7 +187,7 @@
<h1>How to predict antimicrobial resistance</h1> <h1>How to predict antimicrobial resistance</h1>
<h4 class="author">Matthijs S. Berends</h4> <h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">29 November 2019</h4> <h4 class="date">11 December 2019</h4>
<div class="hidden name"><code>resistance_predict.Rmd</code></div> <div class="hidden name"><code>resistance_predict.Rmd</code></div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -45,7 +45,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>
@ -206,7 +206,7 @@ A methods paper about this package has been preprinted at bioRxiv. It was update
<p> <p>
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a> <a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used in over 70 countries</strong><br> <strong>Used in over 70 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 75 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p> Since its first public release in early 2018, this package has been downloaded over 25,000 times from 78 countries <small>(as of December 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p>
<br><br> <br><br>
</div> </div>
<div id="partners" class="section level4"> <div id="partners" class="section level4">
@ -272,7 +272,7 @@ A methods paper about this package has been preprinted at bioRxiv. It was update
<div id="latest-released-version" class="section level4"> <div id="latest-released-version" class="section level4">
<h4 class="hasAnchor"> <h4 class="hasAnchor">
<a href="#latest-released-version" class="anchor"></a>Latest released version</h4> <a href="#latest-released-version" class="anchor"></a>Latest released version</h4>
<p>This package is available <a href="https://cran.r-project.org/package=AMR">on the official R network (CRAN)</a>, which has a peer-reviewed submission process. Install this package in R with:</p> <p>This package is available <a href="https://cran.r-project.org/package=AMR">here on the official R network (CRAN)</a>, which has a peer-reviewed submission process. Install this package in R from CRAN by using the command:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span>(<span class="st">"AMR"</span>)</a></code></pre></div> <div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span>(<span class="st">"AMR"</span>)</a></code></pre></div>
<p>It will be downloaded and installed automatically. For RStudio, click on the menu <em>Tools</em> &gt; <em>Install Packages…</em> and then type in “AMR” and press <kbd>Install</kbd>.</p> <p>It will be downloaded and installed automatically. For RStudio, click on the menu <em>Tools</em> &gt; <em>Install Packages…</em> and then type in “AMR” and press <kbd>Install</kbd>.</p>
<p><strong>Note:</strong> Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.</p> <p><strong>Note:</strong> Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.</p>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>
@ -231,6 +231,17 @@
</div> </div>
<div id="amr-0-9-0-9002" class="section level1">
<h1 class="page-header">
<a href="#amr-0-9-0-9002" class="anchor"></a>AMR 0.9.0.9002<small> Unreleased </small>
</h1>
<div id="last-updated-16-dec-2019" class="section level2">
<h2 class="hasAnchor">
<a href="#last-updated-16-dec-2019" class="anchor"></a><small>Last updated: 16-Dec-2019</small>
</h2>
<p>Website updates</p>
</div>
</div>
<div id="amr-0-9-0" class="section level1"> <div id="amr-0-9-0" class="section level1">
<h1 class="page-header"> <h1 class="page-header">
<a href="#amr-0-9-0" class="anchor"></a>AMR 0.9.0<small> 2019-11-29 </small> <a href="#amr-0-9-0" class="anchor"></a>AMR 0.9.0<small> 2019-11-29 </small>
@ -1390,6 +1401,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav"> <div id="tocnav">
<h2>Contents</h2> <h2>Contents</h2>
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-9-0-9002">0.9.0.9002</a></li>
<li><a href="#amr-0-9-0">0.9.0</a></li> <li><a href="#amr-0-9-0">0.9.0</a></li>
<li><a href="#amr-0-8-0">0.8.0</a></li> <li><a href="#amr-0-8-0">0.8.0</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li> <li><a href="#amr-0-7-1">0.7.1</a></li>

BIN
docs/reference/as.rsi-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
docs/reference/as.rsi-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

View File

@ -86,7 +86,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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">0.9.0</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9002</span>
</span> </span>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -18,7 +18,7 @@ We created this package for both routine analysis and academic research (as part
<p> <p>
<a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a> <a href="./countries.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used in over 70 countries</strong><br> <strong>Used in over 70 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded over 25,000 times from 75 countries <small>(as of November 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br> Since its first public release in early 2018, this package has been downloaded over 25,000 times from 78 countries <small>(as of December 2019, <a href="https://cran-logs.rstudio.com" target="_blank">CRAN logs</a>)</small>. Click the map to enlarge.</p><br><br>
</div> </div>
#### Partners #### Partners
@ -80,7 +80,7 @@ Developers
#### Latest released version #### Latest released version
This package is available [on the official R network (CRAN)](https://cran.r-project.org/package=AMR), which has a peer-reviewed submission process. Install this package in R with: This package is available [here on the official R network (CRAN)](https://cran.r-project.org/package=AMR), which has a peer-reviewed submission process. Install this package in R from CRAN by using the command:
```r ```r
install.packages("AMR") install.packages("AMR")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

After

Width:  |  Height:  |  Size: 1.6 MiB