mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 14:41:51 +02:00
(v1.3.0.9008) also tibble printing for ab
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 1.3.0.9007
|
||||
Version: 1.3.0.9008
|
||||
Date: 2020-08-26
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
|
@ -40,6 +40,7 @@ S3method(format,bug_drug_combinations)
|
||||
S3method(kurtosis,data.frame)
|
||||
S3method(kurtosis,default)
|
||||
S3method(kurtosis,matrix)
|
||||
S3method(pillar_shaft,ab)
|
||||
S3method(pillar_shaft,disk)
|
||||
S3method(pillar_shaft,mic)
|
||||
S3method(pillar_shaft,mo)
|
||||
@ -62,6 +63,7 @@ S3method(skewness,matrix)
|
||||
S3method(summary,mic)
|
||||
S3method(summary,mo)
|
||||
S3method(summary,rsi)
|
||||
S3method(type_sum,ab)
|
||||
S3method(type_sum,disk)
|
||||
S3method(type_sum,mic)
|
||||
S3method(type_sum,mo)
|
||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 1.3.0.9007
|
||||
# AMR 1.3.0.9008
|
||||
## <small>Last updated: 26 August 2020</small>
|
||||
|
||||
### New
|
||||
|
@ -575,9 +575,9 @@ isFALSE <- function(x) {
|
||||
deparse1 <- function(expr, collapse = " ", width.cutoff = 500L, ...) {
|
||||
paste(deparse(expr, width.cutoff, ...), collapse = collapse)
|
||||
}
|
||||
file.size <- function (...) {
|
||||
file.size <- function(...) {
|
||||
base::file.info(...)$size
|
||||
}
|
||||
file.mtime <- function (...) {
|
||||
file.mtime <- function(...) {
|
||||
base::file.info(...)$mtime
|
||||
}
|
||||
|
20
R/ab.R
20
R/ab.R
@ -467,6 +467,26 @@ is.ab <- function(x) {
|
||||
inherits(x, "ab")
|
||||
}
|
||||
|
||||
|
||||
#' @method pillar_shaft ab
|
||||
#' @export
|
||||
pillar_shaft.ab <- function(x, ...) {
|
||||
# import from the pillar package, without being dependent on it!
|
||||
style_na <- import_fn("style_na", "pillar", error_on_fail = FALSE)
|
||||
new_pillar_shaft_simple <- import_fn("new_pillar_shaft_simple", "pillar", error_on_fail = FALSE)
|
||||
out <- format(x)
|
||||
out[is.na(x)] <- style_na(NA)
|
||||
new_pillar_shaft_simple(out,
|
||||
align = "left",
|
||||
min_width = 4)
|
||||
}
|
||||
|
||||
#' @method type_sum ab
|
||||
#' @export
|
||||
type_sum.ab <- function(x, ...) {
|
||||
"ab"
|
||||
}
|
||||
|
||||
#' @method print ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
|
@ -40,17 +40,12 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
|
||||
#' **Note:** This function does not translate MIC values to RSI values. Use [as.rsi()] for that. \cr
|
||||
#' **Note:** When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
|
||||
#'
|
||||
#' Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:
|
||||
#' - Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
|
||||
#' - Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;
|
||||
#' - Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;
|
||||
#' - Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;
|
||||
#' - Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;
|
||||
#' - Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
|
||||
#' - Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
|
||||
#' - Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
|
||||
#' Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules. These rules are:
|
||||
#'
|
||||
#' These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use `eucast_rules(..., rules = "all")`, or set the default behaviour of the `[eucast_rules()]` function with `options(AMR.eucast_rules = "all")` (or any other valid input value(s) to the `rules` parameter).
|
||||
#' 1. A drug **with** enzyme inhibitor will be set to S if the drug **without** enzyme inhibitor is S
|
||||
#' 2. A drug **without** enzyme inhibitor will be set to R if the drug **with** enzyme inhibitor is R
|
||||
#'
|
||||
#' These rules are not applied at default, since they are not approved by EUCAST. To use these rules, use `eucast_rules(..., rules = "all")`, or set the default behaviour of the `[eucast_rules()]` function with `options(AMR.eucast_rules = "all")` (or any other valid input value(s) to the `rules` parameter).
|
||||
#'
|
||||
#' The file containing all EUCAST rules is located here: <https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.
|
||||
#'
|
||||
|
@ -19,9 +19,11 @@
|
||||
# Visit our website for more info: https://msberends.github.io/AMR. #
|
||||
# ==================================================================== #
|
||||
|
||||
globalVariables(c("ab",
|
||||
globalVariables(c(".rowid",
|
||||
"ab",
|
||||
"ab_txt",
|
||||
"angle",
|
||||
"antibiotic",
|
||||
"antibiotics",
|
||||
"atc_group1",
|
||||
"atc_group2",
|
||||
@ -35,9 +37,11 @@ globalVariables(c("ab",
|
||||
"group",
|
||||
"hjust",
|
||||
"input",
|
||||
"intrinsic_resistant",
|
||||
"isolates",
|
||||
"lang",
|
||||
"lookup",
|
||||
"microorganism",
|
||||
"microorganisms",
|
||||
"microorganisms.codes",
|
||||
"microorganisms.old",
|
||||
|
4
R/zzz.R
4
R/zzz.R
@ -29,6 +29,8 @@
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
# support for tibble headers (type_sum) and tibble columns content (pillar_shaft)
|
||||
s3_register("pillar::pillar_shaft", "ab")
|
||||
s3_register("tibble::type_sum", "ab")
|
||||
s3_register("pillar::pillar_shaft", "mo")
|
||||
s3_register("tibble::type_sum", "mo")
|
||||
s3_register("pillar::pillar_shaft", "rsi")
|
||||
@ -87,7 +89,7 @@ create_MO.old_lookup <- function() {
|
||||
}
|
||||
|
||||
# copied from vctrs::s3_register
|
||||
s3_register <- function (generic, class, method = NULL) {
|
||||
s3_register <- function(generic, class, method = NULL) {
|
||||
stopifnot(is.character(generic), length(generic) == 1)
|
||||
stopifnot(is.character(class), length(class) == 1)
|
||||
pieces <- strsplit(generic, "::")[[1]]
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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-1309007" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9007">
|
||||
<a href="#amr-1309007" class="anchor"></a>AMR 1.3.0.9007<small> Unreleased </small>
|
||||
<div id="amr-1309008" class="section level1">
|
||||
<h1 class="page-header" data-toc-text="1.3.0.9008">
|
||||
<a href="#amr-1309008" class="anchor"></a>AMR 1.3.0.9008<small> Unreleased </small>
|
||||
</h1>
|
||||
<div id="last-updated-26-august-2020" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
|
@ -2,7 +2,7 @@ pandoc: 2.7.3
|
||||
pkgdown: 1.5.1.9000
|
||||
pkgdown_sha: eae56f08694abebf93cdfc0dd8e9ede06d8c815f
|
||||
articles: []
|
||||
last_built: 2020-08-26T09:09Z
|
||||
last_built: 2020-08-26T13:33Z
|
||||
urls:
|
||||
reference: https://msberends.github.io/AMR/reference
|
||||
article: https://msberends.github.io/AMR/articles
|
||||
|
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -302,18 +302,12 @@ Leclercq et al. <strong>EUCAST expert rules in antimicrobial susceptibility test
|
||||
|
||||
<p><strong>Note:</strong> This function does not translate MIC values to RSI values. Use <code><a href='as.rsi.html'>as.rsi()</a></code> for that. <br />
|
||||
<strong>Note:</strong> When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.</p>
|
||||
<p>Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:</p><ul>
|
||||
<li><p>Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;</p></li>
|
||||
<li><p>Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;</p></li>
|
||||
<li><p>Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;</p></li>
|
||||
<li><p>Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;</p></li>
|
||||
<li><p>Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;</p></li>
|
||||
<li><p>Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;</p></li>
|
||||
<li><p>Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;</p></li>
|
||||
<li><p>Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.</p></li>
|
||||
</ul>
|
||||
<p>Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules. These rules are:</p><ol>
|
||||
<li><p>A drug <strong>with</strong> enzyme inhibitor will be set to S if the drug <strong>without</strong> enzyme inhibitor is S</p></li>
|
||||
<li><p>A drug <strong>without</strong> enzyme inhibitor will be set to R if the drug <strong>with</strong> enzyme inhibitor is R</p></li>
|
||||
</ol>
|
||||
|
||||
<p>These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use <code>eucast_rules(..., rules = "all")</code>, or set the default behaviour of the <code>[eucast_rules()]</code> function with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR.eucast_rules = "all")</a></code> (or any other valid input value(s) to the <code>rules</code> parameter).</p>
|
||||
<p>These rules are not applied at default, since they are not approved by EUCAST. To use these rules, use <code>eucast_rules(..., rules = "all")</code>, or set the default behaviour of the <code>[eucast_rules()]</code> function with <code><a href='https://rdrr.io/r/base/options.html'>options(AMR.eucast_rules = "all")</a></code> (or any other valid input value(s) to the <code>rules</code> parameter).</p>
|
||||
<p>The file containing all EUCAST rules is located here: <a href='https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv'>https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv</a>.</p>
|
||||
<h2 class="hasAnchor" id="antibiotics"><a class="anchor" href="#antibiotics"></a>Antibiotics</h2>
|
||||
|
||||
|
@ -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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</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.3.0.9007</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9008</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -50,19 +50,13 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
|
||||
\strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link[=as.rsi]{as.rsi()}} for that. \cr
|
||||
\strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
|
||||
|
||||
Before further processing, some non-EUCAST rules can be applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are then applied to all isolates, are:
|
||||
\itemize{
|
||||
\item Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
|
||||
\item Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;
|
||||
\item Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;
|
||||
\item Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;
|
||||
\item Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;
|
||||
\item Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
|
||||
\item Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
|
||||
\item Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
|
||||
Before further processing, two non-EUCAST rules about drug combinations can be applied to improve the efficacy of the EUCAST rules. These rules are:
|
||||
\enumerate{
|
||||
\item A drug \strong{with} enzyme inhibitor will be set to S if the drug \strong{without} enzyme inhibitor is S
|
||||
\item A drug \strong{without} enzyme inhibitor will be set to R if the drug \strong{with} enzyme inhibitor is R
|
||||
}
|
||||
|
||||
These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use \code{eucast_rules(..., rules = "all")}, or set the default behaviour of the \verb{[eucast_rules()]} function with \code{options(AMR.eucast_rules = "all")} (or any other valid input value(s) to the \code{rules} parameter).
|
||||
These rules are not applied at default, since they are not approved by EUCAST. To use these rules, use \code{eucast_rules(..., rules = "all")}, or set the default behaviour of the \verb{[eucast_rules()]} function with \code{options(AMR.eucast_rules = "all")} (or any other valid input value(s) to the \code{rules} parameter).
|
||||
|
||||
The file containing all EUCAST rules is located here: \url{https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}.
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ test_that("mo_property works", {
|
||||
expect_equal(mo_year("Escherichia coli"), 1919)
|
||||
|
||||
expect_equal(mo_shortname("Escherichia coli"), "E. coli")
|
||||
expect_equal(mo_shortname("Escherichia"), "E. spp.")
|
||||
expect_equal(mo_shortname("Escherichia"), "Escherichia")
|
||||
expect_equal(mo_shortname("Staphylococcus aureus"), "S. aureus")
|
||||
expect_equal(mo_shortname("Staphylococcus aureus", Becker = TRUE), "S. aureus")
|
||||
expect_equal(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en"), "CoPS")
|
||||
|
Reference in New Issue
Block a user