2019-05-23 16:58:59 +02:00
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --> < html lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< meta charset = "utf-8" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2020-12-24 23:29:10 +01:00
< title > How to determine multi-drug resistance (MDR) • AMR (for R)< / title >
2019-05-23 16:58:59 +02:00
<!-- favicons --> < link rel = "icon" type = "image/png" sizes = "16x16" href = "../favicon-16x16.png" >
< link rel = "icon" type = "image/png" sizes = "32x32" href = "../favicon-32x32.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "180x180" href = "../apple-touch-icon.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "120x120" href = "../apple-touch-icon-120x120.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "76x76" href = "../apple-touch-icon-76x76.png" >
< link rel = "apple-touch-icon" type = "image/png" sizes = "60x60" href = "../apple-touch-icon-60x60.png" >
2020-12-27 00:07:00 +01:00
<!-- jquery --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity = "sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin = "anonymous" > < / script > <!-- Bootstrap --> < link href = "https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css" rel = "stylesheet" crossorigin = "anonymous" >
2020-12-24 23:29:10 +01:00
< script src = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity = "sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin = "anonymous" > < / script > <!-- bootstrap - toc --> < link rel = "stylesheet" href = "../bootstrap-toc.css" >
2020-04-17 19:16:30 +02:00
< script src = "../bootstrap-toc.js" > < / script > <!-- Font Awesome icons --> < link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity = "sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin = "anonymous" >
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity = "sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin = "anonymous" >
<!-- clipboard.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity = "sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin = "anonymous" > < / script > <!-- headroom.js --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity = "sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity = "sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin = "anonymous" > < / script > <!-- pkgdown --> < link href = "../pkgdown.css" rel = "stylesheet" >
2020-02-23 20:56:11 +01:00
< script src = "../pkgdown.js" > < / script > < link href = "../extra.css" rel = "stylesheet" >
2019-05-23 16:58:59 +02:00
< script src = "../extra.js" > < / script > < meta property = "og:title" content = "How to determine multi-drug resistance (MDR)" >
2020-04-13 21:09:56 +02:00
< meta property = "og:description" content = "AMR" >
2021-12-12 11:07:02 +01:00
< meta property = "og:image" content = "https://msberends.github.io/AMR/logo.svg" >
2021-08-16 21:54:34 +02:00
< meta name = "twitter:card" content = "summary_large_image" >
< meta name = "twitter:creator" content = "@msberends" >
< meta name = "twitter:site" content = "@univgroningen" >
2019-05-23 16:58:59 +02:00
<!-- mathjax --> < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity = "sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin = "anonymous" > < / script > < script src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity = "sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin = "anonymous" > < / script > <!-- [if lt IE 9]>
< script src = "https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js" > < / script >
< script src = "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" > < / script >
<![endif]-->
< / head >
2020-04-17 19:16:30 +02:00
< body data-spy = "scroll" data-target = "#toc" >
2021-07-23 21:42:11 +02:00
2019-05-23 16:58:59 +02:00
< div class = "container template-article" >
< header > < div class = "navbar navbar-default navbar-fixed-top" role = "navigation" >
< div class = "container" >
< div class = "navbar-header" >
< button type = "button" class = "navbar-toggle collapsed" data-toggle = "collapse" data-target = "#navbar" aria-expanded = "false" >
< span class = "sr-only" > Toggle navigation< / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< / button >
< span class = "navbar-brand" >
< a class = "navbar-link" href = "../index.html" > AMR (for R)< / a >
2022-03-14 16:36:10 +01:00
< span class = "version label label-default" data-toggle = "tooltip" data-placement = "bottom" title = "Released version" > 1.8.1< / span >
2019-05-23 16:58:59 +02:00
< / span >
< / div >
< div id = "navbar" class = "navbar-collapse collapse" >
< ul class = "nav navbar-nav" >
< li >
< a href = "../index.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-home" > < / span >
2019-05-23 16:58:59 +02:00
Home
< / a >
< / li >
< li class = "dropdown" >
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" role = "button" aria-expanded = "false" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-question-circle" > < / span >
2019-05-23 16:58:59 +02:00
How to
< span class = "caret" > < / span >
< / a >
< ul class = "dropdown-menu" role = "menu" >
< li >
< a href = "../articles/AMR.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-directions" > < / span >
2019-05-23 16:58:59 +02:00
Conduct AMR analysis
< / a >
< / li >
< li >
< a href = "../articles/resistance_predict.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-dice" > < / span >
2019-05-23 16:58:59 +02:00
Predict antimicrobial resistance
< / a >
< / li >
2020-08-17 21:49:58 +02:00
< li >
< a href = "../articles/datasets.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-database" > < / span >
2020-08-17 21:49:58 +02:00
2020-09-03 20:59:21 +02:00
Data sets for download / own use
2020-08-17 21:49:58 +02:00
< / a >
< / li >
2020-04-13 21:09:56 +02:00
< li >
< a href = "../articles/PCA.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-compress" > < / span >
2020-04-13 21:09:56 +02:00
Conduct principal component analysis for AMR
< / a >
< / li >
2019-05-23 16:58:59 +02:00
< li >
< a href = "../articles/MDR.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-skull-crossbones" > < / span >
2019-05-23 16:58:59 +02:00
Determine multi-drug resistance (MDR)
< / a >
< / li >
< li >
< a href = "../articles/WHONET.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-globe-americas" > < / span >
2019-05-23 16:58:59 +02:00
Work with WHONET data
< / a >
< / li >
< li >
< a href = "../articles/SPSS.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-file-upload" > < / span >
2019-05-23 16:58:59 +02:00
Import data from SPSS/SAS/Stata
< / a >
< / li >
< li >
< a href = "../articles/EUCAST.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-exchange-alt" > < / span >
2019-05-23 16:58:59 +02:00
Apply EUCAST rules
< / a >
< / li >
< li >
< a href = "../reference/mo_property.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-bug" > < / span >
2019-05-23 16:58:59 +02:00
Get properties of a microorganism
< / a >
< / li >
< li >
< a href = "../reference/ab_property.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-capsules" > < / span >
2019-05-23 16:58:59 +02:00
Get properties of an antibiotic
< / a >
< / li >
< li >
< a href = "../articles/benchmarks.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-shipping-fast" > < / span >
2019-05-23 16:58:59 +02:00
Other: benchmarks
< / a >
< / li >
< / ul >
< / li >
< li >
2020-07-28 18:39:57 +02:00
< a href = "../reference/index.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-book-open" > < / span >
2019-05-23 16:58:59 +02:00
Manual
< / a >
< / li >
< li >
< a href = "../authors.html" >
2021-07-23 21:42:11 +02:00
< span class = "fa fa-users" > < / span >
2019-05-23 16:58:59 +02:00
Authors
< / a >
< / li >
< li >
2020-07-28 18:39:57 +02:00
< a href = "../news/index.html" >
2021-05-24 15:29:17 +02:00
< span class = "far fa-newspaper" > < / span >
2019-05-23 16:58:59 +02:00
Changelog
< / a >
< / li >
< / ul >
< ul class = "nav navbar-nav navbar-right" >
< li >
2021-07-23 21:42:11 +02:00
< a href = "https://github.com/msberends/AMR" class = "external-link" >
2021-05-24 15:29:17 +02:00
< span class = "fab fa-github" > < / span >
2019-05-23 16:58:59 +02:00
Source Code
< / a >
< / li >
< / ul >
< / div >
<!-- /.nav - collapse -->
< / div >
<!-- /.container -->
< / div >
<!-- /.navbar -->
2019-09-26 21:58:06 +02:00
2021-12-06 11:12:30 +01:00
< / header > < div class = "row" >
2019-05-23 16:58:59 +02:00
< div class = "col-md-9 contents" >
< div class = "page-header toc-ignore" >
2022-03-14 16:36:10 +01:00
< h1 data-toc-skip > How to determine multi-drug resistance
(MDR)< / h1 >
2019-05-23 16:58:59 +02:00
2021-12-06 11:12:30 +01:00
< small class = "dont-index" > Source: < a href = "https://github.com/msberends/AMR/blob/HEAD/vignettes/MDR.Rmd" class = "external-link" > < code > vignettes/MDR.Rmd< / code > < / a > < / small >
2019-05-23 16:58:59 +02:00
< div class = "hidden name" > < code > MDR.Rmd< / code > < / div >
< / div >
2022-03-14 16:36:10 +01:00
< p > With the function < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > , you can determine which
micro-organisms are multi-drug resistant organisms (MDRO).< / p >
2021-12-06 11:12:30 +01:00
< div class = "section level3" >
< h3 id = "type-of-input" > Type of input< a class = "anchor" aria-label = "anchor" href = "#type-of-input" > < / a >
< / h3 >
2022-03-14 16:36:10 +01:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function takes a data set as input, such as a
regular < code > data.frame< / code > . It tries to automatically determine the
right columns for info about your isolates, such as the name of the
species and all columns with results of antimicrobial agents. See the
help page for more info about how to set the right settings for your
data with the command < code > < a href = "../reference/mdro.html" > ?mdro< / a > < / code > .< / p >
< p > For WHONET data (and most other data), all settings are automatically
set correctly.< / p >
2019-11-09 11:33:22 +01:00
< / div >
2021-12-06 11:12:30 +01:00
< div class = "section level3" >
< h3 id = "guidelines" > Guidelines< a class = "anchor" aria-label = "anchor" href = "#guidelines" > < / a >
< / h3 >
2022-03-14 16:36:10 +01:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function support multiple guidelines. You can
select a guideline with the < code > guideline< / code > parameter. Currently
supported guidelines are (case-insensitive):< / p >
2019-05-23 16:58:59 +02:00
< ul >
2019-11-09 11:33:22 +01:00
< li >
< p > < code > guideline = "CMI2012"< / code > (default)< / p >
2022-03-14 16:36:10 +01:00
< p > Magiorakos AP, Srinivasan A < em > et al.< / em > “Multidrug-resistant,
extensively drug-resistant and pandrug-resistant bacteria: an
international expert proposal for interim standard definitions for
acquired resistance.” Clinical Microbiology and Infection (2012) (< a href = "https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext" class = "external-link" > link< / a > )< / p >
2020-07-09 14:12:11 +02:00
< / li >
2019-11-09 11:33:22 +01:00
< li >
2022-03-14 16:36:10 +01:00
< p > < code > guideline = "EUCAST3.2"< / code > (or simply
< code > guideline = "EUCAST"< / code > )< / p >
< p > The European international guideline - EUCAST Expert Rules Version
3.2 “Intrinsic Resistance and Unusual Phenotypes” (< a href = "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf" class = "external-link" > link< / a > )< / p >
2020-12-07 16:06:42 +01:00
< / li >
< li >
< p > < code > guideline = "EUCAST3.1"< / code > < / p >
2022-03-14 16:36:10 +01:00
< p > The European international guideline - EUCAST Expert Rules Version
3.1 “Intrinsic Resistance and Exceptional Phenotypes Tables” (< a href = "https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf" class = "external-link" > link< / a > )< / p >
2020-07-09 14:12:11 +02:00
< / li >
2019-11-09 11:33:22 +01:00
< li >
< p > < code > guideline = "TB"< / code > < / p >
2022-03-14 16:36:10 +01:00
< p > The international guideline for multi-drug resistant tuberculosis -
World Health Organization “Companion handbook to the WHO guidelines for
the programmatic management of drug-resistant tuberculosis” (< a href = "https://www.who.int/tb/publications/pmdt_companionhandbook/en/" class = "external-link" > link< / a > )< / p >
2020-07-09 14:12:11 +02:00
< / li >
2019-11-09 11:33:22 +01:00
< li >
< p > < code > guideline = "MRGN"< / code > < / p >
2022-03-14 16:36:10 +01:00
< p > The German national guideline - Mueller < em > et al.< / em > (2015)
Antimicrobial Resistance and Infection Control 4:7. DOI:
10.1186/s13756-015-0047-6< / p >
2020-07-09 14:12:11 +02:00
< / li >
2019-11-09 11:33:22 +01:00
< li >
< p > < code > guideline = "BRMO"< / code > < / p >
2022-03-14 16:36:10 +01:00
< p > The Dutch national guideline - Rijksinstituut voor Volksgezondheid en
Milieu “WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen)
(ZKH)” (< a href = "https://www.rivm.nl/wip-richtlijn-brmo-bijzonder-resistente-micro-organismen-zkh" class = "external-link" > link< / a > )< / p >
2019-11-09 11:33:22 +01:00
< / li >
2019-05-23 16:58:59 +02:00
< / ul >
2022-03-14 16:36:10 +01:00
< p > Please suggest your own (country-specific) guidelines by letting us
know: < a href = "https://github.com/msberends/AMR/issues/new" class = "external-link uri" > https://github.com/msberends/AMR/issues/new< / a > .< / p >
2021-12-06 11:12:30 +01:00
< div class = "section level4" >
< h4 id = "custom-guidelines" > Custom Guidelines< a class = "anchor" aria-label = "anchor" href = "#custom-guidelines" > < / a >
< / h4 >
2022-03-14 16:36:10 +01:00
< p > You can also use your own custom guideline. Custom guidelines can be
set with the < code > < a href = "../reference/mdro.html" > custom_mdro_guideline()< / a > < / code > function. This is of
great importance if you have custom rules to determine MDROs in your
hospital, e.g., rules that are dependent on ward, state of contact
isolation or other variables in your data.< / p >
< p > If you are familiar with < code > < a href = "https://dplyr.tidyverse.org/reference/case_when.html" class = "external-link" > case_when()< / a > < / code > of the
< code > dplyr< / code > package, you will recognise the input method to set
your own rules. Rules must be set using what R considers to be the
‘ formula notation’ :< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb1" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "va" > custom< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > custom_mdro_guideline< / a > < / span > < span class = "op" > (< / span > < span class = "va" > CIP< / span > < span class = "op" > ==< / span > < span class = "st" > "R"< / span > < span class = "op" > & < / span > < span class = "va" > age< / span > < span class = "op" > > < / span > < span class = "fl" > 60< / span > < span class = "op" > ~< / span > < span class = "st" > "Elderly Type A"< / span > ,
< span class = "va" > ERY< / span > < span class = "op" > ==< / span > < span class = "st" > "R"< / span > < span class = "op" > & < / span > < span class = "va" > age< / span > < span class = "op" > > < / span > < span class = "fl" > 60< / span > < span class = "op" > ~< / span > < span class = "st" > "Elderly Type B"< / span > < span class = "op" > )< / span > < / code > < / pre > < / div >
2022-03-14 16:36:10 +01:00
< p > If a row/an isolate matches the first rule, the value after the first
< code > ~< / code > (in this case < em > ‘ Elderly Type A’ < / em > ) will be set as
MDRO value. Otherwise, the second rule will be tried and so on. The
maximum number of rules is unlimited.< / p >
< p > You can print the rules set in the console for an overview. Colours
will help reading it if your console supports colours.< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb2" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "va" > custom< / span >
2021-01-24 14:48:56 +01:00
< span class = "co" > # A set of custom MDRO rules:< / span >
2021-04-27 10:27:13 +02:00
< span class = "co" > # 1. If CIP is "R" and age is higher than 60 then: Elderly Type A< / span >
< span class = "co" > # 2. If ERY is "R" and age is higher than 60 then: Elderly Type B< / span >
< span class = "co" > # 3. Otherwise: Negative< / span >
2021-01-24 14:48:56 +01:00
< span class = "co" > # < / span >
< span class = "co" > # Unmatched rows will return NA.< / span >
2021-05-24 15:29:17 +02:00
< span class = "co" > # Results will be of class < factor> , with ordered levels: Negative < Elderly Type A < Elderly Type B< / span > < / code > < / pre > < / div >
2022-03-14 16:36:10 +01:00
< p > The outcome of the function can be used for the
< code > guideline< / code > argument in the < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb3" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "va" > x< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "va" > example_isolates< / span > , guideline < span class = "op" > =< / span > < span class = "va" > custom< / span > < span class = "op" > )< / span >
2021-08-16 21:54:34 +02:00
< span class = "co" > # Determining MDROs based on custom rules, resulting in factor levels:< / span >
2021-07-23 21:42:11 +02:00
< span class = "co" > # Negative < Elderly Type A < Elderly Type B.< / span >
< span class = "co" > # - Custom MDRO rule 1: `CIP == "R" & age > 60` (198 rows matched)< / span >
< span class = "co" > # - Custom MDRO rule 2: `ERY == "R" & age > 60` (732 rows matched)< / span >
< span class = "fu" > < a href = "https://rdrr.io/r/base/table.html" class = "external-link" > table< / a > < / span > < span class = "op" > (< / span > < span class = "va" > x< / span > < span class = "op" > )< / span >
2021-01-24 14:48:56 +01:00
< span class = "co" > # x< / span >
< span class = "co" > # Negative Elderly Type A Elderly Type B < / span >
2021-05-24 15:29:17 +02:00
< span class = "co" > # 1070 198 732< / span > < / code > < / pre > < / div >
2022-03-14 16:36:10 +01:00
< p > The rules set (the < code > custom< / code > object in this case) could be
exported to a shared file location using < code > < a href = "https://rdrr.io/r/base/readRDS.html" class = "external-link" > saveRDS()< / a > < / code > if you
collaborate with multiple users. The custom rules set could then be
imported using < code > < a href = "https://rdrr.io/r/base/readRDS.html" class = "external-link" > readRDS()< / a > < / code > .< / p >
2021-01-24 14:48:56 +01:00
< / div >
< / div >
2021-12-06 11:12:30 +01:00
< div class = "section level3" >
< h3 id = "examples" > Examples< a class = "anchor" aria-label = "anchor" href = "#examples" > < / a >
< / h3 >
2022-03-14 16:36:10 +01:00
< p > The < code > < a href = "../reference/mdro.html" > mdro()< / a > < / code > function always returns an ordered
< code > factor< / code > for predefined guidelines. For example, the output
of the default guideline by Magiorakos < em > et al.< / em > returns a
< code > factor< / code > with levels ‘ Negative’ , ‘ MDR’ , ‘ XDR’ or ‘ PDR’ in
that order.< / p >
< p > The next example uses the < code > example_isolates< / code > data set.
This is a data set included with this package and contains full
antibiograms of 2,000 microbial isolates. It reflects reality and can be
used to practise AMR data analysis. If we test the MDR/XDR/PDR guideline
on this data set, we get:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb4" > < pre class = "downlit sourceCode r" >
2021-07-23 21:42:11 +02:00
< code class = "sourceCode R" > < span class = "kw" > < a href = "https://rdrr.io/r/base/library.html" class = "external-link" > library< / a > < / span > < span class = "op" > (< / span > < span class = "va" > < a href = "https://dplyr.tidyverse.org" class = "external-link" > dplyr< / a > < / span > < span class = "op" > )< / span > < span class = "co" > # to support pipes: %> %< / span >
< span class = "kw" > < a href = "https://rdrr.io/r/base/library.html" class = "external-link" > library< / a > < / span > < span class = "op" > (< / span > < span class = "va" > < a href = "https://github.com/msberends/cleaner" class = "external-link" > cleaner< / a > < / span > < span class = "op" > )< / span > < span class = "co" > # to create frequency tables< / span > < / code > < / pre > < / div >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb5" > < pre class = "downlit sourceCode r" >
2021-12-06 11:12:30 +01:00
< code class = "sourceCode R" > < span class = "va" > example_isolates< / span > < span class = "op" > < a href = "https://magrittr.tidyverse.org/reference/pipe.html" class = "external-link" > %> %< / a > < / span >
< span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "op" > )< / span > < span class = "op" > < a href = "https://magrittr.tidyverse.org/reference/pipe.html" class = "external-link" > %> %< / a > < / span >
2021-07-23 21:42:11 +02:00
< span class = "fu" > < a href = "https://rdrr.io/pkg/cleaner/man/freq.html" class = "external-link" > freq< / a > < / span > < span class = "op" > (< / span > < span class = "op" > )< / span > < span class = "co" > # show frequency table of the result< / span >
< span class = "co" > # ℹ Using column 'mo' as input for `col_mo`.< / span >
< span class = "co" > # Auto-guessing columns suitable for analysis... OK.< / span >
< span class = "co" > # ℹ Reliability would be improved if these antimicrobial results would be< / span >
< span class = "co" > # available too: ampicillin/sulbactam (SAM), aztreonam (ATM), cefotetan< / span >
< span class = "co" > # (CTT), ceftaroline (CPT), daptomycin (DAP), doripenem (DOR), ertapenem< / span >
< span class = "co" > # (ETP), fusidic acid (FUS), gentamicin-high (GEH), levofloxacin (LVX),< / span >
< span class = "co" > # minocycline (MNO), netilmicin (NET), polymyxin B (PLB),< / span >
< span class = "co" > # quinupristin/dalfopristin (QDA), streptomycin-high (STH), telavancin (TLV)< / span >
< span class = "co" > # and ticarcillin/clavulanic acid (TCC)< / span >
< span class = "co" > # Table 1 - Staphylococcus aureus... OK.< / span >
< span class = "co" > # Table 2 - Enterococcus spp.... OK.< / span >
< span class = "co" > # Table 3 - Enterobacteriaceae... OK.< / span >
< span class = "co" > # Table 4 - Pseudomonas aeruginosa... OK.< / span >
< span class = "co" > # Table 5 - Acinetobacter spp.... OK.< / span >
2022-03-14 16:36:10 +01:00
< span class = "co" > # Warning: in `mdro()`: NA introduced for isolates where the available percentage of< / span >
< span class = "co" > # antimicrobial classes was below 50% (set with `pct_required_classes`)< / span > < / code > < / pre > < / div >
< p > Only results with ‘ R’ are considered as resistance. Use
< code > combine_SI = FALSE< / code > to also consider ‘ I’ as resistance.< / p >
< p > Determining multidrug-resistant organisms (MDRO), according to:
Guideline: Multidrug-resistant, extensively drug-resistant and
pandrug-resistant bacteria: an international expert proposal for interim
standard definitions for acquired resistance. Author(s): Magiorakos AP,
Srinivasan A, Carey RB, …, Vatopoulos A, Weber JT, Monnet DL Source:
Clinical Microbiology and Infection 18:3, 2012; doi:
10.1111/j.1469-0691.2011.03570.x< / p >
2021-12-06 11:12:30 +01:00
< p > (16 isolates had no test results)< / p >
2019-11-09 11:33:22 +01:00
< p > < strong > Frequency table< / strong > < / p >
< p > Class: factor > ordered (numeric)< br >
2020-02-23 20:56:11 +01:00
Length: 2,000< br >
2022-03-14 16:36:10 +01:00
Levels: 4: Negative < Multi-drug-resistant (MDR) < Extensively
drug-resistant …< br >
2021-12-06 11:12:30 +01:00
Available: 1,729 (86.45%, NA: 271 = 13.55%)< br >
2019-11-09 11:33:22 +01:00
Unique: 2< / p >
2022-03-14 16:36:10 +01:00
< table style = "width:100%;" class = "table" >
< colgroup >
< col width = "4%" >
< col width = "38%" >
< col width = "9%" >
< col width = "12%" >
< col width = "16%" >
< col width = "19%" >
< / colgroup >
2019-11-09 11:33:22 +01:00
< thead > < tr class = "header" >
< th align = "left" > < / th >
< th align = "left" > Item< / th >
< th align = "right" > Count< / th >
< th align = "right" > Percent< / th >
< th align = "right" > Cum. Count< / th >
< th align = "right" > Cum. Percent< / th >
< / tr > < / thead >
< tbody >
< tr class = "odd" >
< td align = "left" > 1< / td >
< td align = "left" > Negative< / td >
2021-12-06 11:12:30 +01:00
< td align = "right" > 1601< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 92.6%< / td >
2021-12-06 11:12:30 +01:00
< td align = "right" > 1601< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 92.6%< / td >
2019-11-09 11:33:22 +01:00
< / tr >
< tr class = "even" >
< td align = "left" > 2< / td >
< td align = "left" > Multi-drug-resistant (MDR)< / td >
2021-02-09 12:28:15 +01:00
< td align = "right" > 128< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 7.4%< / td >
2021-12-06 11:12:30 +01:00
< td align = "right" > 1729< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 100.0%< / td >
2019-11-09 11:33:22 +01:00
< / tr >
< / tbody >
< / table >
2022-03-14 16:36:10 +01:00
< p > For another example, I will create a data set to determine multi-drug
resistant TB:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb6" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "co" > # random_rsi() is a helper function to generate< / span >
2020-12-24 23:29:10 +01:00
< span class = "co" > # a random vector with values S, I and R< / span >
2021-07-23 21:42:11 +02:00
< span class = "va" > my_TB_data< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "https://rdrr.io/r/base/data.frame.html" class = "external-link" > data.frame< / a > < / span > < span class = "op" > (< / span > rifampicin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
2020-12-24 23:29:10 +01:00
isoniazid < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
gatifloxacin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
ethambutol < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
pyrazinamide < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
moxifloxacin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
2021-05-24 15:29:17 +02:00
kanamycin < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > < span class = "op" > )< / span > < / code > < / pre > < / div >
2022-03-14 16:36:10 +01:00
< p > Because all column names are automatically verified for valid drug
names or codes, this would have worked exactly the same way:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb7" > < pre class = "downlit sourceCode r" >
2021-07-23 21:42:11 +02:00
< code class = "sourceCode R" > < span class = "va" > my_TB_data< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "https://rdrr.io/r/base/data.frame.html" class = "external-link" > data.frame< / a > < / span > < span class = "op" > (< / span > RIF < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
2020-12-24 23:29:10 +01:00
INH < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
GAT < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
ETH < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
PZA < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
MFX < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > ,
2021-05-24 15:29:17 +02:00
KAN < span class = "op" > =< / span > < span class = "fu" > < a href = "../reference/random.html" > random_rsi< / a > < / span > < span class = "op" > (< / span > < span class = "fl" > 5000< / span > < span class = "op" > )< / span > < span class = "op" > )< / span > < / code > < / pre > < / div >
2019-11-09 11:33:22 +01:00
< p > The data set now looks like this:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb8" > < pre class = "downlit sourceCode r" >
2021-07-23 21:42:11 +02:00
< code class = "sourceCode R" > < span class = "fu" > < a href = "https://rdrr.io/r/utils/head.html" class = "external-link" > head< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > )< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin< / span >
2022-03-14 16:36:10 +01:00
< span class = "co" > # 1 R S S I S I< / span >
< span class = "co" > # 2 R S S S R I< / span >
< span class = "co" > # 3 S S I I S S< / span >
< span class = "co" > # 4 I I S S S S< / span >
< span class = "co" > # 5 I R R I R R< / span >
< span class = "co" > # 6 I R S I S S< / span >
2020-04-17 19:16:30 +02:00
< span class = "co" > # kanamycin< / span >
2022-03-14 16:36:10 +01:00
< span class = "co" > # 1 I< / span >
< span class = "co" > # 2 R< / span >
2021-12-23 18:56:28 +01:00
< span class = "co" > # 3 R< / span >
2022-03-14 16:36:10 +01:00
< span class = "co" > # 4 S< / span >
2021-12-23 18:56:28 +01:00
< span class = "co" > # 5 I< / span >
2022-03-14 16:36:10 +01:00
< span class = "co" > # 6 I< / span > < / code > < / pre > < / div >
< p > We can now add the interpretation of MDR-TB to our data set. You can
use:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb9" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "fu" > < a href = "../reference/mdro.html" > mdro< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > , guideline < span class = "op" > =< / span > < span class = "st" > "TB"< / span > < span class = "op" > )< / span > < / code > < / pre > < / div >
2019-11-09 11:33:22 +01:00
< p > or its shortcut < code > < a href = "../reference/mdro.html" > mdr_tb()< / a > < / code > :< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb10" > < pre class = "downlit sourceCode r" >
< code class = "sourceCode R" > < span class = "va" > my_TB_data< / span > < span class = "op" > $< / span > < span class = "va" > mdr< / span > < span class = "op" > < -< / span > < span class = "fu" > < a href = "../reference/mdro.html" > mdr_tb< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > )< / span >
< span class = "co" > # ℹ No column found as input for `col_mo`, assuming all rows contain< / span >
2021-07-23 21:42:11 +02:00
< span class = "co" > # Mycobacterium tuberculosis.< / span >
< span class = "co" > # Auto-guessing columns suitable for analysis... OK.< / span >
< span class = "co" > # ℹ Reliability would be improved if these antimicrobial results would be< / span >
< span class = "co" > # available too: capreomycin (CAP), rifabutin (RIB) and rifapentine (RFP)< / span >
< span class = "co" > # < / span >
< span class = "co" > # Only results with 'R' are considered as resistance. Use `combine_SI = FALSE` to also consider 'I' as resistance.< / span >
< span class = "co" > # < / span >
< span class = "co" > # Determining multidrug-resistant organisms (MDRO), according to:< / span >
< span class = "co" > # Guideline: Companion handbook to the WHO guidelines for the programmatic< / span >
< span class = "co" > # management of drug-resistant tuberculosis< / span >
< span class = "co" > # Author(s): WHO (World Health Organization)< / span >
< span class = "co" > # Version: WHO/HTM/TB/2014.11, 2014< / span >
< span class = "co" > # Source: https://www.who.int/tb/publications/pmdt_companionhandbook/en/< / span > < / code > < / pre > < / div >
2019-11-09 11:33:22 +01:00
< p > Create a frequency table of the results:< / p >
2021-05-24 15:29:17 +02:00
< div class = "sourceCode" id = "cb11" > < pre class = "downlit sourceCode r" >
2021-07-23 21:42:11 +02:00
< code class = "sourceCode R" > < span class = "fu" > < a href = "https://rdrr.io/pkg/cleaner/man/freq.html" class = "external-link" > freq< / a > < / span > < span class = "op" > (< / span > < span class = "va" > my_TB_data< / span > < span class = "op" > $< / span > < span class = "va" > mdr< / span > < span class = "op" > )< / span > < / code > < / pre > < / div >
2019-07-29 13:33:48 +02:00
< p > < strong > Frequency table< / strong > < / p >
2019-05-23 19:39:07 +02:00
< p > Class: factor > ordered (numeric)< br >
2020-02-23 20:56:11 +01:00
Length: 5,000< br >
2022-03-14 16:36:10 +01:00
Levels: 5: Negative < Mono-resistant < Poly-resistant <
Multi-drug-resistant < …< br >
Available: 5,000 (100%, NA: 0 = 0%)< br >
2019-05-23 18:53:18 +02:00
Unique: 5< / p >
2022-03-14 16:36:10 +01:00
< table style = "width:100%;" class = "table" >
< colgroup >
< col width = "4%" >
< col width = "38%" >
< col width = "9%" >
< col width = "12%" >
< col width = "16%" >
< col width = "19%" >
< / colgroup >
2019-05-23 18:53:18 +02:00
< thead > < tr class = "header" >
< th align = "left" > < / th >
< th align = "left" > Item< / th >
< th align = "right" > Count< / th >
< th align = "right" > Percent< / th >
< th align = "right" > Cum. Count< / th >
< th align = "right" > Cum. Percent< / th >
< / tr > < / thead >
< tbody >
< tr class = "odd" >
< td align = "left" > 1< / td >
2019-09-26 21:58:06 +02:00
< td align = "left" > Mono-resistant< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 3175< / td >
< td align = "right" > 63.50%< / td >
< td align = "right" > 3175< / td >
< td align = "right" > 63.50%< / td >
2019-05-23 18:53:18 +02:00
< / tr >
< tr class = "even" >
< td align = "left" > 2< / td >
2020-10-04 19:26:43 +02:00
< td align = "left" > Negative< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 1057< / td >
< td align = "right" > 21.14%< / td >
< td align = "right" > 4232< / td >
< td align = "right" > 84.64%< / td >
2019-05-23 18:53:18 +02:00
< / tr >
< tr class = "odd" >
< td align = "left" > 3< / td >
2020-10-04 19:26:43 +02:00
< td align = "left" > Multi-drug-resistant< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 431< / td >
< td align = "right" > 8.62%< / td >
< td align = "right" > 4663< / td >
< td align = "right" > 93.26%< / td >
2019-05-23 18:53:18 +02:00
< / tr >
< tr class = "even" >
< td align = "left" > 4< / td >
2019-09-26 21:58:06 +02:00
< td align = "left" > Poly-resistant< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 236< / td >
< td align = "right" > 4.72%< / td >
< td align = "right" > 4899< / td >
< td align = "right" > 97.98%< / td >
2019-05-23 18:53:18 +02:00
< / tr >
< tr class = "odd" >
< td align = "left" > 5< / td >
2019-11-09 11:33:22 +01:00
< td align = "left" > Extensively drug-resistant< / td >
2022-03-14 16:36:10 +01:00
< td align = "right" > 101< / td >
< td align = "right" > 2.02%< / td >
2019-07-29 13:33:48 +02:00
< td align = "right" > 5000< / td >
2019-09-30 16:45:36 +02:00
< td align = "right" > 100.00%< / td >
2019-05-23 18:53:18 +02:00
< / tr >
< / tbody >
< / table >
< / div >
2019-11-09 11:33:22 +01:00
< / div >
2019-05-23 16:58:59 +02:00
2020-04-13 21:09:56 +02:00
< div class = "col-md-3 hidden-xs hidden-sm" id = "pkgdown-sidebar" >
2019-09-26 21:58:06 +02:00
2019-05-23 16:58:59 +02:00
< / div >
< / div >
2019-09-26 21:58:06 +02:00
2019-05-23 16:58:59 +02:00
< footer > < div class = "copyright" >
2021-07-23 21:42:11 +02:00
< p > < / p >
2022-03-14 16:36:10 +01:00
< p > Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
Erwin E. A. Hassing.< / p >
2019-05-23 16:58:59 +02:00
< / div >
< div class = "pkgdown" >
2021-07-23 21:42:11 +02:00
< p > < / p >
2022-03-14 16:36:10 +01:00
< p > Site built with < a href = "https://pkgdown.r-lib.org/" class = "external-link" > pkgdown< / a >
2.0.2.< / p >
2019-05-23 16:58:59 +02:00
< / div >
2019-09-26 21:58:06 +02:00
2019-05-23 16:58:59 +02:00
< / footer >
< / div >
2020-02-23 20:56:11 +01:00
2021-07-23 21:42:11 +02:00
2020-02-23 20:56:11 +01:00
< / body >
2019-05-23 16:58:59 +02:00
< / html >