mirror of https://github.com/msberends/AMR.git
fixes
This commit is contained in:
parent
9e99e66f01
commit
f7dd890b79
|
@ -1,5 +1,5 @@
|
||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.8.2.9106
|
Version: 1.8.2.9107
|
||||||
Date: 2023-02-06
|
Date: 2023-02-06
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
|
2
NEWS.md
2
NEWS.md
|
@ -1,4 +1,4 @@
|
||||||
# AMR 1.8.2.9106
|
# AMR 1.8.2.9107
|
||||||
|
|
||||||
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,9 @@ TAXONOMY_VERSION <- list(
|
||||||
)
|
)
|
||||||
|
|
||||||
globalVariables(c(
|
globalVariables(c(
|
||||||
|
".mo",
|
||||||
".rowid",
|
".rowid",
|
||||||
|
".syndromic_group",
|
||||||
"ab",
|
"ab",
|
||||||
"ab_txt",
|
"ab_txt",
|
||||||
"affect_ab_name",
|
"affect_ab_name",
|
||||||
|
@ -105,8 +107,9 @@ globalVariables(c(
|
||||||
"atc_group1",
|
"atc_group1",
|
||||||
"atc_group2",
|
"atc_group2",
|
||||||
"base_ab",
|
"base_ab",
|
||||||
"ci_min",
|
|
||||||
"ci_max",
|
"ci_max",
|
||||||
|
"ci_min",
|
||||||
|
"clinical_breakpoints",
|
||||||
"code",
|
"code",
|
||||||
"cols",
|
"cols",
|
||||||
"count",
|
"count",
|
||||||
|
@ -130,14 +133,15 @@ globalVariables(c(
|
||||||
"language",
|
"language",
|
||||||
"lookup",
|
"lookup",
|
||||||
"method",
|
"method",
|
||||||
"mic",
|
|
||||||
"mic ",
|
"mic ",
|
||||||
|
"mic",
|
||||||
"microorganism",
|
"microorganism",
|
||||||
"microorganisms",
|
"microorganisms",
|
||||||
"microorganisms.codes",
|
"microorganisms.codes",
|
||||||
"mo",
|
"mo",
|
||||||
"name",
|
"name",
|
||||||
"new",
|
"new",
|
||||||
|
"numerator",
|
||||||
"observations",
|
"observations",
|
||||||
"old",
|
"old",
|
||||||
"old_name",
|
"old_name",
|
||||||
|
@ -149,13 +153,15 @@ globalVariables(c(
|
||||||
"reference.rule_group",
|
"reference.rule_group",
|
||||||
"reference.version",
|
"reference.version",
|
||||||
"rowid",
|
"rowid",
|
||||||
"sir",
|
|
||||||
"clinical_breakpoints",
|
|
||||||
"rule_group",
|
"rule_group",
|
||||||
"rule_name",
|
"rule_name",
|
||||||
|
"S",
|
||||||
"se_max",
|
"se_max",
|
||||||
"se_min",
|
"se_min",
|
||||||
|
"SI",
|
||||||
|
"sir",
|
||||||
"species",
|
"species",
|
||||||
|
"syndromic_group",
|
||||||
"total",
|
"total",
|
||||||
"txt",
|
"txt",
|
||||||
"type",
|
"type",
|
||||||
|
|
|
@ -363,7 +363,7 @@ set_ab_names <- function(data, ..., property = "name", language = get_AMR_locale
|
||||||
|
|
||||||
if (is.data.frame(data)) {
|
if (is.data.frame(data)) {
|
||||||
if (tryCatch(length(list(...)) > 0, error = function(e) TRUE)) {
|
if (tryCatch(length(list(...)) > 0, error = function(e) TRUE)) {
|
||||||
out <- tryCatch(suppressWarnings(c(...)), error = function(e) NULL)
|
out <- tryCatch(suppressWarnings(unlist(list(...))), error = function(e) NULL)
|
||||||
if (!is.null(out)) {
|
if (!is.null(out)) {
|
||||||
df <- data[, out, drop = FALSE]
|
df <- data[, out, drop = FALSE]
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
#' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see *Source*.
|
#' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see *Source*.
|
||||||
#' @param combine_SI a [logical] to indicate whether all susceptibility should be determined by results of either S or I, instead of only S (defaults to `TRUE`)
|
#' @param combine_SI a [logical] to indicate whether all susceptibility should be determined by results of either S or I, instead of only S (defaults to `TRUE`)
|
||||||
#' @param sep a separating character for antibiotic columns in combination antibiograms
|
#' @param sep a separating character for antibiotic columns in combination antibiograms
|
||||||
|
#' @param object an [antibiogram()] object
|
||||||
|
#' @param ... method extensions
|
||||||
#' @details This function returns a table with values between 0 and 100 for *susceptibility*, not resistance.
|
#' @details This function returns a table with values between 0 and 100 for *susceptibility*, not resistance.
|
||||||
#'
|
#'
|
||||||
#' **Remember that you should filter your data to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set with one of the four available algorithms.
|
#' **Remember that you should filter your data to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set with one of the four available algorithms.
|
||||||
|
@ -314,7 +316,7 @@ antibiogram <- function(x,
|
||||||
if (identical(select, import_fn("select", "dplyr", error_on_fail = FALSE))) {
|
if (identical(select, import_fn("select", "dplyr", error_on_fail = FALSE))) {
|
||||||
antibiotics <- suppressWarnings(x %>% select({{ antibiotics }}) %>% colnames())
|
antibiotics <- suppressWarnings(x %>% select({{ antibiotics }}) %>% colnames())
|
||||||
} else {
|
} else {
|
||||||
antibiotics <- x %>% select(antibiotics) %>% colnames()
|
antibiotics <- colnames(x[, antibiotics, drop = FALSE])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,9 +449,9 @@ plot.antibiogram <- function(x, ...) {
|
||||||
df <- df[order(df$mo), , drop = FALSE]
|
df <- df[order(df$mo), , drop = FALSE]
|
||||||
}
|
}
|
||||||
mo_levels = unique(df$mo)
|
mo_levels = unique(df$mo)
|
||||||
mfrow_old <- par()$mfrow
|
mfrow_old <- graphics::par()$mfrow
|
||||||
sqrt_levels <- sqrt(length(mo_levels))
|
sqrt_levels <- sqrt(length(mo_levels))
|
||||||
par(mfrow = c(ceiling(sqrt_levels), floor(sqrt_levels)))
|
graphics::par(mfrow = c(ceiling(sqrt_levels), floor(sqrt_levels)))
|
||||||
for (i in seq_along(mo_levels)) {
|
for (i in seq_along(mo_levels)) {
|
||||||
mo <- mo_levels[i]
|
mo <- mo_levels[i]
|
||||||
df_sub <- df[df$mo == mo, , drop = FALSE]
|
df_sub <- df[df$mo == mo, , drop = FALSE]
|
||||||
|
@ -463,12 +465,14 @@ plot.antibiogram <- function(x, ...) {
|
||||||
main = mo,
|
main = mo,
|
||||||
legend = NULL)
|
legend = NULL)
|
||||||
}
|
}
|
||||||
par(mfrow = mfrow_old)
|
graphics::par(mfrow = mfrow_old)
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @export
|
#' @export
|
||||||
#' @noRd
|
#' @noRd
|
||||||
barplot.antibiogram <- plot.antibiogram
|
barplot.antibiogram <- function(height, ...) {
|
||||||
|
plot(height, ...)
|
||||||
|
}
|
||||||
|
|
||||||
#' @method autoplot antibiogram
|
#' @method autoplot antibiogram
|
||||||
#' @rdname antibiogram
|
#' @rdname antibiogram
|
||||||
|
|
|
@ -63,6 +63,10 @@ antibiogram(
|
||||||
|
|
||||||
\item{sep}{a separating character for antibiotic columns in combination antibiograms}
|
\item{sep}{a separating character for antibiotic columns in combination antibiograms}
|
||||||
|
|
||||||
|
\item{...}{method extensions}
|
||||||
|
|
||||||
|
\item{object}{an \code{\link[=antibiogram]{antibiogram()}} object}
|
||||||
|
|
||||||
\item{as_kable}{a \link{logical} to indicate whether the printing should be done using \code{\link[knitr:kable]{knitr::kable()}} (which is the default in non-interactive sessions)}
|
\item{as_kable}{a \link{logical} to indicate whether the printing should be done using \code{\link[knitr:kable]{knitr::kable()}} (which is the default in non-interactive sessions)}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
|
|
Loading…
Reference in New Issue