mirror of
https://github.com/msberends/AMR.git
synced 2024-12-24 19:26:12 +01:00
(v1.4.0.9050) ab selectors base R
This commit is contained in:
parent
175e33abba
commit
afc325c314
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 1.4.0.9049
|
||||
Version: 1.4.0.9050
|
||||
Date: 2020-12-27
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
|
3
NEWS.md
3
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 1.4.0.9049
|
||||
# AMR 1.4.0.9050
|
||||
## <small>Last updated: 27 December 2020</small>
|
||||
|
||||
### New
|
||||
@ -47,6 +47,7 @@
|
||||
* Fix for printing class <mo> in tibbles when all values are `NA`
|
||||
* Fix for `mo_shortname()` when the input contains `NA`
|
||||
* If `as.mo()` takes more than 30 seconds, some suggestions will be done to improve speed
|
||||
* Lost dependency on the `tidyselect` package for using antibiotic selectors such as `carbapenems()` and `aminoglycosides()`
|
||||
|
||||
### Other
|
||||
* All messages and warnings thrown by this package now break sentences on whole words
|
||||
|
@ -25,11 +25,9 @@
|
||||
|
||||
#' Antibiotic class selectors
|
||||
#'
|
||||
#' Use these selection helpers inside any function that allows [Tidyverse selection helpers](https://tidyselect.r-lib.org/reference/language.html), such as [`select()`][dplyr::select()] and [`pivot_longer()`][tidyr::pivot_longer()]. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
|
||||
#' These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
|
||||
#' @inheritParams filter_ab_class
|
||||
#' @details All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector like e.g. [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
|
||||
#'
|
||||
#' **N.B. These functions require the `tidyselect` package to be installed**, that comes with the `dplyr` package. An error will be thrown if the `tidyselect` package is not installed, or if the functions are used outside a function that allows [Tidyverse selection helpers](https://tidyselect.r-lib.org/reference/language.html) such as [`select()`][dplyr::select()] and [`pivot_longer()`][tidyr::pivot_longer()]`.
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @seealso [filter_ab_class()] for the `filter()` equivalent.
|
||||
#' @name antibiotic_class_selectors
|
||||
@ -37,6 +35,14 @@
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
#' example_isolates[, c(carbapenems())]
|
||||
#' # this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':
|
||||
#' example_isolates[, c("mo", aminoglycosides())]
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#'
|
||||
#' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
@ -151,10 +157,13 @@ ab_selector <- function(ab_class, function_name) {
|
||||
meet_criteria(ab_class, allow_class = "character", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(function_name, allow_class = "character", has_length = 1, .call_depth = 1)
|
||||
|
||||
peek_vars_tidyselect <- import_fn("peek_vars", "tidyselect")
|
||||
vars_vct <- peek_vars_tidyselect(fn = function_name)
|
||||
vars_df <- data.frame(as.list(vars_vct), stringsAsFactors = FALSE)[1, , drop = FALSE]
|
||||
colnames(vars_df) <- vars_vct
|
||||
for (i in seq_len(length(sys.frames()))) {
|
||||
vars_df <- sys.frames()[[i]]$x
|
||||
if (!is.null(vars_df) && is.data.frame(vars_df)) {
|
||||
break
|
||||
}
|
||||
}
|
||||
stop_ifnot(is.data.frame(vars_df), "the ", function_name, "() function must be used inside dplyr verbs or a data.frame call.")
|
||||
ab_in_data <- get_column_abx(vars_df, info = FALSE)
|
||||
|
||||
if (length(ab_in_data) == 0) {
|
||||
|
@ -27,7 +27,7 @@
|
||||
#'
|
||||
#' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use [is_new_episode()] that also supports grouping with the `dplyr` package.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame] containing isolates. Can be omitted when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
|
||||
#' @param x a [data.frame] containing isolates. Can be left blank when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
|
||||
#' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column with a date class
|
||||
#' @param col_patient_id column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive)
|
||||
#' @param col_mo column name of the IDs of the microorganisms (see [as.mo()]), defaults to the first column of class [`mo`]. Values will be coerced using [as.mo()].
|
||||
@ -46,7 +46,7 @@
|
||||
#' @param include_unknown logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code `"UNKNOWN"`, which defaults to `FALSE`. For WHONET users, this means that all records with organism code `"con"` (*contamination*) will be excluded at default. Isolates with a microbial ID of `NA` will always be excluded as first isolate.
|
||||
#' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], or arguments passed on to [key_antibiotics()] when using [filter_first_weighted_isolate()]
|
||||
#' @details
|
||||
#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be omitted, please see *Examples*.
|
||||
#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*.
|
||||
#'
|
||||
#' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but more efficient for data sets containing microorganism codes or names.
|
||||
#'
|
||||
|
@ -27,7 +27,7 @@
|
||||
#'
|
||||
#' These function can be used to determine first isolates (see [first_isolate()]). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first *weighted* isolates.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be omitted when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`.
|
||||
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`.
|
||||
#' @param y,z character vectors to compare
|
||||
#' @inheritParams first_isolate
|
||||
#' @param universal_1,universal_2,universal_3,universal_4,universal_5,universal_6 column names of **broad-spectrum** antibiotics, case-insensitive. See details for which antibiotics will be used at default (which are guessed with [guess_ab_col()]).
|
||||
@ -36,7 +36,7 @@
|
||||
#' @param warnings give a warning about missing antibiotic columns (they will be ignored)
|
||||
#' @param ... other arguments passed on to functions
|
||||
#' @details
|
||||
#' The [key_antibiotics()] function is context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be omitted, please see *Examples*.
|
||||
#' The [key_antibiotics()] function is context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*.
|
||||
#'
|
||||
#' The function [key_antibiotics()] returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using [key_antibiotics_equal()], to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (`"."`) by [key_antibiotics()] and ignored by [key_antibiotics_equal()].
|
||||
#'
|
||||
|
4
R/mdro.R
4
R/mdro.R
@ -27,7 +27,7 @@
|
||||
#'
|
||||
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be omitted when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
|
||||
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
|
||||
#' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos *et al.* (2012, Clinical Microbiology and Infection) will be followed, please see *Details*.
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate.
|
||||
@ -35,7 +35,7 @@
|
||||
#' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
|
||||
#' @inheritSection eucast_rules Antibiotics
|
||||
#' @details
|
||||
#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be omitted, please see *Examples*.
|
||||
#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*.
|
||||
#'
|
||||
#' For the `pct_required_classes` argument, values above 1 will be divided by 100. This is to support both fractions (`0.75` or `3/4`) and percentages (`75`).
|
||||
#'
|
||||
|
2
R/mo.R
2
R/mo.R
@ -438,7 +438,7 @@ exec_as.mo <- function(x,
|
||||
|
||||
strip_whitespace <- function(x, dyslexia_mode) {
|
||||
# all whitespaces (tab, new lines, etc.) should be one space
|
||||
# and spaces before and after should be omitted
|
||||
# and spaces before and after should be left blank
|
||||
trimmed <- trimws2(x)
|
||||
# also, make sure the trailing and leading characters are a-z or 0-9
|
||||
# in case of non-regex
|
||||
|
@ -27,7 +27,7 @@
|
||||
#'
|
||||
#' Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x any character (vector) that can be coerced to a valid microorganism code with [as.mo()]. Can be omitted for auto-guessing the column containing microorganism codes when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()], please see *Examples*.
|
||||
#' @param x any character (vector) that can be coerced to a valid microorganism code with [as.mo()]. Can be left blank for auto-guessing the column containing microorganism codes when used inside `dplyr` verbs, such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()], please see *Examples*.
|
||||
#' @param property one of the column names of the [microorganisms] data set: `r paste0('"``', colnames(microorganisms), '\``"', collapse = ", ")`, or must be `"shortname"`
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can be overwritten by setting the option `AMR_locale`, e.g. `options(AMR_locale = "de")`, see [translate]. Also used to translate text like "no growth". Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param ... other arguments passed on to [as.mo()], such as 'allow_uncertain' and 'ignore_pattern'
|
||||
|
@ -149,8 +149,8 @@ set_mo_source <- function(path, destination = getOption("AMR_mo_source", "~/mo_s
|
||||
|
||||
} else if (path %like% "[.]xlsx?$") {
|
||||
# is Excel file (old or new)
|
||||
read_excel <- import_fn("read_excel", "readxl")
|
||||
df <- read_excel(path)
|
||||
stop_ifnot_installed("readxl")
|
||||
df <- readxl::read_excel(path)
|
||||
|
||||
} else if (path %like% "[.]tsv$") {
|
||||
df <- utils::read.table(header = TRUE, sep = "\t", stringsAsFactors = FALSE)
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -236,9 +236,9 @@
|
||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div id="amr-1409049" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.4.0.9049">
|
||||
<a href="#amr-1409049" class="anchor"></a>AMR 1.4.0.9049<small> Unreleased </small>
|
||||
<div id="amr-1409050" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.4.0.9050">
|
||||
<a href="#amr-1409050" class="anchor"></a>AMR 1.4.0.9050<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-27-december-2020" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@ -306,6 +306,7 @@
|
||||
<li><p>Fix for printing class <mo> in tibbles when all values are <code>NA</code></mo></p></li>
|
||||
<li><p>Fix for <code><a href="../reference/mo_property.html">mo_shortname()</a></code> when the input contains <code>NA</code></p></li>
|
||||
<li><p>If <code><a href="../reference/as.mo.html">as.mo()</a></code> takes more than 30 seconds, some suggestions will be done to improve speed</p></li>
|
||||
<li><p>Lost dependency on the <code>tidyselect</code> package for using antibiotic selectors such as <code><a href="../reference/antibiotic_class_selectors.html">carbapenems()</a></code> and <code><a href="../reference/antibiotic_class_selectors.html">aminoglycosides()</a></code></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="other" class="section level3">
|
||||
|
@ -12,7 +12,7 @@ articles:
|
||||
datasets: datasets.html
|
||||
resistance_predict: resistance_predict.html
|
||||
welcome_to_AMR: welcome_to_AMR.html
|
||||
last_built: 2020-12-27T14:06Z
|
||||
last_built: 2020-12-27T19:32Z
|
||||
urls:
|
||||
reference: https://msberends.github.io/AMR//reference
|
||||
article: https://msberends.github.io/AMR//articles
|
||||
|
@ -49,7 +49,7 @@
|
||||
<script src="../extra.js"></script>
|
||||
|
||||
<meta property="og:title" content="Antibiotic class selectors — antibiotic_class_selectors" />
|
||||
<meta property="og:description" content="Use these selection helpers inside any function that allows Tidyverse selection helpers, such as select() and pivot_longer(). They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations." />
|
||||
<meta property="og:description" content="These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -239,7 +239,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>Use these selection helpers inside any function that allows <a href='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selection helpers</a>, such as <code><a href='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code> and <code><a href='https://tidyr.tidyverse.org/reference/pivot_longer.html'>pivot_longer()</a></code>. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.</p>
|
||||
<p>These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ab_class</span><span class='op'>(</span><span class='va'>ab_class</span><span class='op'>)</span>
|
||||
@ -282,7 +282,6 @@
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the <a href='antibiotics.html'>antibiotics</a> data set. This means that a selector like e.g. <code>aminoglycosides()</code> will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.</p>
|
||||
<p><strong>N.B. These functions require the <code>tidyselect</code> package to be installed</strong>, that comes with the <code>dplyr</code> package. An error will be thrown if the <code>tidyselect</code> package is not installed, or if the functions are used outside a function that allows <a href='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selection helpers</a> such as <code><a href='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code> and <code><a href='https://tidyr.tidyverse.org/reference/pivot_longer.html'>pivot_longer()</a></code>`.</p>
|
||||
<h2 class="hasAnchor" id="reference-data-publicly-available"><a class="anchor" href="#reference-data-publicly-available"></a>Reference data publicly available</h2>
|
||||
|
||||
|
||||
@ -298,7 +297,15 @@
|
||||
<div class='dont-index'><p><code><a href='filter_ab_class.html'>filter_ab_class()</a></code> for the <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code> equivalent.</p></div>
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
|
||||
<pre class="examples"><span class='co'># `example_isolates` is a dataset available in the AMR package.</span>
|
||||
<span class='co'># See ?example_isolates.</span>
|
||||
|
||||
<span class='co'># this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):</span>
|
||||
<span class='va'>example_isolates</span><span class='op'>[</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fu'>carbapenems</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span><span class='op'>]</span>
|
||||
<span class='co'># this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':</span>
|
||||
<span class='va'>example_isolates</span><span class='op'>[</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"mo"</span>, <span class='fu'>aminoglycosides</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span><span class='op'>]</span>
|
||||
|
||||
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
|
||||
|
||||
<span class='co'># this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):</span>
|
||||
<span class='va'>example_isolates</span> <span class='op'>%>%</span>
|
||||
|
@ -83,7 +83,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9048</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -239,7 +239,7 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
<p>Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use <code><a href='is_new_episode.html'>is_new_episode()</a></code> that also supports grouping with the <code>dplyr</code> package.</p>
|
||||
<p>Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use <code><a href='get_episode.html'>is_new_episode()</a></code> that also supports grouping with the <code>dplyr</code> package.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>first_isolate</span><span class='op'>(</span>
|
||||
@ -285,7 +285,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates. Can be omitted when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates. Can be left blank when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_date</th>
|
||||
@ -366,8 +366,8 @@
|
||||
<p>A <code><a href='https://rdrr.io/r/base/logical.html'>logical</a></code> vector</p>
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>These functions are context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be omitted, please see <em>Examples</em>.</p>
|
||||
<p>The <code>first_isolate()</code> function is a wrapper around the <code><a href='is_new_episode.html'>is_new_episode()</a></code> function, but more efficient for data sets containing microorganism codes or names.</p>
|
||||
<p>These functions are context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be left blank, please see <em>Examples</em>.</p>
|
||||
<p>The <code>first_isolate()</code> function is a wrapper around the <code><a href='get_episode.html'>is_new_episode()</a></code> function, but more efficient for data sets containing microorganism codes or names.</p>
|
||||
<p>All isolates with a microbial ID of <code>NA</code> will be excluded as first isolate.</p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Why this is so important</h3>
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9048</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -281,7 +281,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with antibiotics columns, like <code>AMX</code> or <code>amox</code>. Can be omitted when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with antibiotics columns, like <code>AMX</code> or <code>amox</code>. Can be left blank when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_mo</th>
|
||||
@ -331,7 +331,7 @@
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>The <code>key_antibiotics()</code> function is context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be omitted, please see <em>Examples</em>.</p>
|
||||
<p>The <code>key_antibiotics()</code> function is context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be left blank, please see <em>Examples</em>.</p>
|
||||
<p>The function <code>key_antibiotics()</code> returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using <code>key_antibiotics_equal()</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>) by <code>key_antibiotics()</code> and ignored by <code>key_antibiotics_equal()</code>.</p>
|
||||
<p>The <code><a href='first_isolate.html'>first_isolate()</a></code> function only uses this function on the same microbial species from the same patient. Using this, e.g. an MRSA will be included after a susceptible <em>S. aureus</em> (MSSA) is found within the same patient episode. Without key antibiotic comparison it would not. See <code><a href='first_isolate.html'>first_isolate()</a></code> for more info.</p>
|
||||
<p>At default, the antibiotics that are used for <strong>Gram-positive bacteria</strong> are:</p><ul>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -268,7 +268,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with antibiotics columns, like <code>AMX</code> or <code>amox</code>. Can be omitted when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> with antibiotics columns, like <code>AMX</code> or <code>amox</code>. Can be left blank when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>guideline</th>
|
||||
@ -319,7 +319,7 @@ Ordered <a href='https://rdrr.io/r/base/factor.html'>factor</a> with levels <cod
|
||||
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>These functions are context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be omitted, please see <em>Examples</em>.</p>
|
||||
<p>These functions are context-aware when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>. This means that then the <code>x</code> argument can be left blank, please see <em>Examples</em>.</p>
|
||||
<p>For the <code>pct_required_classes</code> argument, values above 1 will be divided by 100. This is to support both fractions (<code>0.75</code> or <code>3/4</code>) and percentages (<code>75</code>).</p>
|
||||
<p>Currently supported guidelines are (case-insensitive):</p><ul>
|
||||
<li><p><code>guideline = "CMI2012"</code> (default)</p>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -301,7 +301,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>any character (vector) that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code>. Can be omitted for auto-guessing the column containing microorganism codes when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>, please see <em>Examples</em>.</p></td>
|
||||
<td><p>any character (vector) that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code>. Can be left blank for auto-guessing the column containing microorganism codes when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>, please see <em>Examples</em>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9046</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -287,7 +287,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates. Can be omitted when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
<td><p>a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a> containing isolates. Can be left blank when used inside <code>dplyr</code> verbs, such as <code><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter()</a></code>, <code><a href='https://dplyr.tidyverse.org/reference/mutate.html'>mutate()</a></code> and <code><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise()</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_ab</th>
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9049</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9050</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -50,12 +50,10 @@ tetracyclines()
|
||||
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
|
||||
}
|
||||
\description{
|
||||
Use these selection helpers inside any function that allows \href{https://tidyselect.r-lib.org/reference/language.html}{Tidyverse selection helpers}, such as \code{\link[dplyr:select]{select()}} and \code{\link[tidyr:pivot_longer]{pivot_longer()}}. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
|
||||
These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
|
||||
}
|
||||
\details{
|
||||
All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the \link{antibiotics} data set. This means that a selector like e.g. \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
|
||||
|
||||
\strong{N.B. These functions require the \code{tidyselect} package to be installed}, that comes with the \code{dplyr} package. An error will be thrown if the \code{tidyselect} package is not installed, or if the functions are used outside a function that allows \href{https://tidyselect.r-lib.org/reference/language.html}{Tidyverse selection helpers} such as \code{\link[dplyr:select]{select()}} and \code{\link[tidyr:pivot_longer]{pivot_longer()}}`.
|
||||
}
|
||||
\section{Reference data publicly available}{
|
||||
|
||||
@ -68,6 +66,14 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/
|
||||
}
|
||||
|
||||
\examples{
|
||||
# `example_isolates` is a dataset available in the AMR package.
|
||||
# See ?example_isolates.
|
||||
|
||||
# this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
example_isolates[, c(carbapenems())]
|
||||
# this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':
|
||||
example_isolates[, c("mo", aminoglycosides())]
|
||||
|
||||
if (require("dplyr")) {
|
||||
|
||||
# this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
|
@ -50,7 +50,7 @@ filter_first_weighted_isolate(
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a \link{data.frame} containing isolates. Can be omitted when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
\item{x}{a \link{data.frame} containing isolates. Can be left blank when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
|
||||
\item{col_date}{column name of the result date (or date that is was received on the lab), defaults to the first column with a date class}
|
||||
|
||||
@ -93,7 +93,7 @@ A \code{\link{logical}} vector
|
||||
Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use \code{\link[=is_new_episode]{is_new_episode()}} that also supports grouping with the \code{dplyr} package.
|
||||
}
|
||||
\details{
|
||||
These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}.
|
||||
These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}.
|
||||
|
||||
The \code{\link[=first_isolate]{first_isolate()}} function is a wrapper around the \code{\link[=is_new_episode]{is_new_episode()}} function, but more efficient for data sets containing microorganism codes or names.
|
||||
|
||||
|
@ -40,7 +40,7 @@ key_antibiotics_equal(
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be omitted when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}.}
|
||||
\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}.}
|
||||
|
||||
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
|
||||
|
||||
@ -68,7 +68,7 @@ key_antibiotics_equal(
|
||||
These function can be used to determine first isolates (see \code{\link[=first_isolate]{first_isolate()}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first \emph{weighted} isolates.
|
||||
}
|
||||
\details{
|
||||
The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}.
|
||||
The \code{\link[=key_antibiotics]{key_antibiotics()}} function is context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}.
|
||||
|
||||
The function \code{\link[=key_antibiotics]{key_antibiotics()}} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}) by \code{\link[=key_antibiotics]{key_antibiotics()}} and ignored by \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}.
|
||||
|
||||
|
@ -40,7 +40,7 @@ mdr_cmi2012(x, guideline = "CMI2012", ...)
|
||||
eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be omitted when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
|
||||
\item{guideline}{a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, please see \emph{Details}.}
|
||||
|
||||
@ -72,7 +72,7 @@ Ordered \link{factor} with levels \code{Negative} < \verb{Positive, unconfirmed}
|
||||
Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.
|
||||
}
|
||||
\details{
|
||||
These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be omitted, please see \emph{Examples}.
|
||||
These functions are context-aware when used inside \code{dplyr} verbs, such as \code{filter()}, \code{mutate()} and \code{summarise()}. This means that then the \code{x} argument can be left blank, please see \emph{Examples}.
|
||||
|
||||
For the \code{pct_required_classes} argument, values above 1 will be divided by 100. This is to support both fractions (\code{0.75} or \code{3/4}) and percentages (\code{75}).
|
||||
|
||||
|
@ -85,7 +85,7 @@ mo_url(x, open = FALSE, language = get_locale(), ...)
|
||||
mo_property(x, property = "fullname", language = get_locale(), ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{any character (vector) that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}. Can be omitted for auto-guessing the column containing microorganism codes when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}, please see \emph{Examples}.}
|
||||
\item{x}{any character (vector) that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}. Can be left blank for auto-guessing the column containing microorganism codes when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}, please see \emph{Examples}.}
|
||||
|
||||
\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can be overwritten by setting the option \code{AMR_locale}, e.g. \code{options(AMR_locale = "de")}, see \link{translate}. Also used to translate text like "no growth". Use \code{language = NULL} or \code{language = ""} to prevent translation.}
|
||||
|
||||
|
@ -47,7 +47,7 @@ ggplot_rsi_predict(
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a \link{data.frame} containing isolates. Can be omitted when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
\item{x}{a \link{data.frame} containing isolates. Can be left blank when used inside \code{dplyr} verbs, such as \code{\link[dplyr:filter]{filter()}}, \code{\link[dplyr:mutate]{mutate()}} and \code{\link[dplyr:summarise]{summarise()}}.}
|
||||
|
||||
\item{col_ab}{column name of \code{x} containing antimicrobial interpretations (\code{"R"}, \code{"I"} and \code{"S"})}
|
||||
|
||||
|
@ -51,7 +51,6 @@ test_that("imports work", {
|
||||
"insertText" = "rstudioapi",
|
||||
"left_join" = "dplyr",
|
||||
"new_pillar_shaft_simple" = "pillar",
|
||||
"peek_vars" = "tidyselect",
|
||||
"read_excel" = "readxl",
|
||||
"read_html" = "xml2",
|
||||
"right_join" = "dplyr",
|
||||
|
Loading…
Reference in New Issue
Block a user