mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 20:06:12 +01:00
(v1.7.1.9002) ab class selectors update
This commit is contained in:
parent
683a0e748a
commit
99be4c7e7e
@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.7.1.9001
|
Version: 1.7.1.9002
|
||||||
Date: 2021-06-05
|
Date: 2021-06-14
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person(role = c("aut", "cre"),
|
person(role = c("aut", "cre"),
|
||||||
@ -59,7 +59,7 @@ Suggests:
|
|||||||
tinytest,
|
tinytest,
|
||||||
xml2
|
xml2
|
||||||
VignetteBuilder: knitr,rmarkdown
|
VignetteBuilder: knitr,rmarkdown
|
||||||
URL: https://msberends.github.io/AMR/, https://github.com/msberends/AMR
|
URL: https://github.com/msberends/AMR, https://msberends.github.io/AMR
|
||||||
BugReports: https://github.com/msberends/AMR/issues
|
BugReports: https://github.com/msberends/AMR/issues
|
||||||
License: GPL-2 | file LICENSE
|
License: GPL-2 | file LICENSE
|
||||||
Encoding: UTF-8
|
Encoding: UTF-8
|
||||||
|
10
NEWS.md
10
NEWS.md
@ -1,8 +1,12 @@
|
|||||||
# `AMR` 1.7.1.9001
|
# `AMR` 1.7.1.9002
|
||||||
## <small>Last updated: 5 June 2021</small>
|
## <small>Last updated: 14 June 2021</small>
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* Added more antibiotic class selectors, such as `lincosamides()` and `lipoglycopeptides()`
|
* Added more antibiotic class selectors: `aminopenicillins()`, `lincosamides()`, `lipoglycopeptides()`, `polymyxins()`, `quinolones()`, `streptogramins()` and `ureidopenicillins()`
|
||||||
|
* Added `ggplot2::autoplot()` generic for classes `<mic>`, `<disk>`, `<rsi>` and `<resistance_predict>`
|
||||||
|
* Fix to prevent introducing `NA`s for old MO codes when running `as.mo()` on them
|
||||||
|
* Added more informative error messages when any of the `proportion_*()` and `count_*()` functions fail
|
||||||
|
* Fix for using antibiotic selectors multiple times in one call (e.g., using in `dplyr::filter()` and immediately after in `dplyr::select()`)
|
||||||
|
|
||||||
|
|
||||||
# `AMR` 1.7.1
|
# `AMR` 1.7.1
|
||||||
|
@ -278,7 +278,7 @@ ab_selector <- function(function_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
# get_current_data() has to run each time, for cases where e.g., filter() and select() are used in same call
|
# get_current_data() has to run each time, for cases where e.g., filter() and select() are used in same call
|
||||||
vars_df <- get_current_data(arg_name = NA, call = -3, reuse_equal_call = FALSE)
|
vars_df <- get_current_data(arg_name = NA, call = -3, reuse_from_1st_call = FALSE)
|
||||||
# to improve speed, get_column_abx() will only run once when e.g. in a select or group call
|
# to improve speed, get_column_abx() will only run once when e.g. in a select or group call
|
||||||
ab_in_data <- get_column_abx(vars_df, info = FALSE, only_rsi_columns = only_rsi_columns, sort = FALSE)
|
ab_in_data <- get_column_abx(vars_df, info = FALSE, only_rsi_columns = only_rsi_columns, sort = FALSE)
|
||||||
|
|
||||||
|
110
R/count.R
110
R/count.R
@ -83,6 +83,12 @@
|
|||||||
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||||
#' total = n()) # NOT the number of tested isolates!
|
#' total = n()) # NOT the number of tested isolates!
|
||||||
#'
|
#'
|
||||||
|
#' # Number of available isolates for a whole antibiotic class
|
||||||
|
#' # (i.e., in this data set columns GEN, TOB, AMK, KAN)
|
||||||
|
#' example_isolates %>%
|
||||||
|
#' group_by(hospital_id) %>%
|
||||||
|
#' summarise(across(aminoglycosides(), n_rsi))
|
||||||
|
#'
|
||||||
#' # Count co-resistance between amoxicillin/clav acid and gentamicin,
|
#' # Count co-resistance between amoxicillin/clav acid and gentamicin,
|
||||||
#' # so we can see that combination therapy does a lot more than mono therapy.
|
#' # so we can see that combination therapy does a lot more than mono therapy.
|
||||||
#' # Please mind that `susceptibility()` calculates percentages right away instead.
|
#' # Please mind that `susceptibility()` calculates percentages right away instead.
|
||||||
@ -108,81 +114,97 @@
|
|||||||
#' }
|
#' }
|
||||||
#' }
|
#' }
|
||||||
count_resistant <- function(..., only_all_tested = FALSE) {
|
count_resistant <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "R",
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = "R",
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_susceptible <- function(..., only_all_tested = FALSE) {
|
count_susceptible <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("S", "I"),
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = c("S", "I"),
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_R <- function(..., only_all_tested = FALSE) {
|
count_R <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "R",
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = "R",
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_IR <- function(..., only_all_tested = FALSE) {
|
count_IR <- function(..., only_all_tested = FALSE) {
|
||||||
if (message_not_thrown_before("count_IR")) {
|
if (message_not_thrown_before("count_IR", entire_session = TRUE)) {
|
||||||
warning_("Using count_IR() is discouraged; use count_resistant() instead to not consider \"I\" being resistant.", call = FALSE)
|
message_("Using `count_IR()` is discouraged; use `count_resistant()` instead to not consider \"I\" being resistant. This note will be shown once for this session.", as_note = FALSE)
|
||||||
remember_thrown_message("count_IR")
|
remember_thrown_message("count_IR")
|
||||||
}
|
}
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("I", "R"),
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = c("I", "R"),
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_I <- function(..., only_all_tested = FALSE) {
|
count_I <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "I",
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = "I",
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_SI <- function(..., only_all_tested = FALSE) {
|
count_SI <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("S", "I"),
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = c("S", "I"),
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_S <- function(..., only_all_tested = FALSE) {
|
count_S <- function(..., only_all_tested = FALSE) {
|
||||||
if (message_not_thrown_before("count_S")) {
|
if (message_not_thrown_before("count_S", entire_session = TRUE)) {
|
||||||
warning_("Using count_S() is discouraged; use count_susceptible() instead to also consider \"I\" being susceptible.", call = FALSE)
|
message_("Using `count_S()` is discouraged; use `count_susceptible()` instead to also consider \"I\" being susceptible. This note will be shown once for this session.", as_note = FALSE)
|
||||||
remember_thrown_message("count_S")
|
remember_thrown_message("count_S")
|
||||||
}
|
}
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "S",
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = "S",
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
#' @export
|
#' @export
|
||||||
count_all <- function(..., only_all_tested = FALSE) {
|
count_all <- function(..., only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("S", "I", "R"),
|
rsi_calc(...,
|
||||||
only_all_tested = only_all_tested,
|
ab_result = c("S", "I", "R"),
|
||||||
only_count = TRUE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = TRUE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname count
|
#' @rdname count
|
||||||
@ -196,11 +218,13 @@ count_df <- function(data,
|
|||||||
language = get_locale(),
|
language = get_locale(),
|
||||||
combine_SI = TRUE,
|
combine_SI = TRUE,
|
||||||
combine_IR = FALSE) {
|
combine_IR = FALSE) {
|
||||||
rsi_calc_df(type = "count",
|
tryCatch(
|
||||||
data = data,
|
rsi_calc_df(type = "count",
|
||||||
translate_ab = translate_ab,
|
data = data,
|
||||||
language = language,
|
translate_ab = translate_ab,
|
||||||
combine_SI = combine_SI,
|
language = language,
|
||||||
combine_IR = combine_IR,
|
combine_SI = combine_SI,
|
||||||
combine_SI_missing = missing(combine_SI))
|
combine_IR = combine_IR,
|
||||||
|
combine_SI_missing = missing(combine_SI)),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ filter_first_weighted_isolate <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||||
@ -104,7 +104,7 @@ key_antibiotics <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
|
|
||||||
key_antimicrobials(x = x,
|
key_antimicrobials(x = x,
|
||||||
@ -170,7 +170,7 @@ filter_ab_class <- function(x,
|
|||||||
if (missing(x) || is_null_or_grouped_tbl(x)) {
|
if (missing(x) || is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- get_current_data(arg_name = "x", call = -2 - .call_depth)
|
x <- get_current_data(arg_name = "x", call = -2 - .call_depth, reuse_from_1st_call = FALSE)
|
||||||
.x_name <- "your_data"
|
.x_name <- "your_data"
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame", .call_depth = .call_depth)
|
meet_criteria(x, allow_class = "data.frame", .call_depth = .call_depth)
|
||||||
|
@ -207,7 +207,7 @@ first_isolate <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||||
@ -618,7 +618,7 @@ filter_first_isolate <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||||
|
@ -130,7 +130,7 @@ key_antimicrobials <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE, is_in = colnames(x))
|
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE, is_in = colnames(x))
|
||||||
@ -232,7 +232,7 @@ all_antimicrobials <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
|
meet_criteria(only_rsi_columns, allow_class = "logical", has_length = 1)
|
||||||
|
2
R/mdro.R
2
R/mdro.R
@ -170,7 +170,7 @@ mdro <- function(x = NULL,
|
|||||||
if (is_null_or_grouped_tbl(x)) {
|
if (is_null_or_grouped_tbl(x)) {
|
||||||
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
|
||||||
# is also fix for using a grouped df as input (a dot as first argument)
|
# is also fix for using a grouped df as input (a dot as first argument)
|
||||||
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
|
x <- tryCatch(get_current_data(arg_name = "x", call = -2, reuse_from_1st_call = FALSE), error = function(e) x)
|
||||||
}
|
}
|
||||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||||
meet_criteria(guideline, allow_class = c("list", "character"), allow_NULL = TRUE)
|
meet_criteria(guideline, allow_class = c("list", "character"), allow_NULL = TRUE)
|
||||||
|
25
R/mo.R
25
R/mo.R
@ -1664,16 +1664,25 @@ pillar_shaft.mo <- function(x, ...) {
|
|||||||
out[is.na(x)] <- font_na(" NA")
|
out[is.na(x)] <- font_na(" NA")
|
||||||
out[x == "UNKNOWN"] <- font_na(" UNKNOWN")
|
out[x == "UNKNOWN"] <- font_na(" UNKNOWN")
|
||||||
|
|
||||||
if (!all(x[!is.na(x)] %in% MO_lookup$mo)) {
|
df <- tryCatch(get_current_data(arg_name = "x",
|
||||||
|
call = 0,
|
||||||
|
reuse_from_1st_call = FALSE),
|
||||||
|
error = function(e) NULL)
|
||||||
|
if (!is.null(df)) {
|
||||||
|
mo_cols <- vapply(FUN.VALUE = logical(1), df, is.mo)
|
||||||
|
} else {
|
||||||
|
mo_cols <- NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!all(x[!is.na(x)] %in% MO_lookup$mo) |
|
||||||
|
(!is.null(df) && !all(unlist(df[, which(mo_cols), drop = FALSE]) %in% MO_lookup$mo))) {
|
||||||
# markup old mo codes
|
# markup old mo codes
|
||||||
out[!x %in% MO_lookup$mo] <- font_italic(font_na(x[!x %in% MO_lookup$mo],
|
out[!x %in% MO_lookup$mo] <- font_italic(font_na(x[!x %in% MO_lookup$mo],
|
||||||
collapse = NULL),
|
collapse = NULL),
|
||||||
collapse = NULL)
|
collapse = NULL)
|
||||||
# throw a warning with the affected column name
|
# throw a warning with the affected column name(s)
|
||||||
mo <- tryCatch(search_type_in_df(get_current_data(arg_name = "x", call = 0), type = "mo", info = FALSE),
|
if (!is.null(mo_cols)) {
|
||||||
error = function(e) NULL)
|
col <- paste0("Column ", vector_or(colnames(df)[mo_cols], quotes = TRUE, sort = FALSE))
|
||||||
if (!is.null(mo)) {
|
|
||||||
col <- paste0("Column '", mo, "'")
|
|
||||||
} else {
|
} else {
|
||||||
col <- "The data"
|
col <- "The data"
|
||||||
}
|
}
|
||||||
@ -2039,12 +2048,16 @@ parse_and_convert <- function(x) {
|
|||||||
x <- as.data.frame(x, stringsAsFactors = FALSE)[[1]]
|
x <- as.data.frame(x, stringsAsFactors = FALSE)[[1]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
x_class <- class(x)
|
||||||
|
x <- as.character(x)
|
||||||
x[is.null(x)] <- NA
|
x[is.null(x)] <- NA
|
||||||
parsed <- iconv(x, to = "UTF-8")
|
parsed <- iconv(x, to = "UTF-8")
|
||||||
parsed[is.na(parsed) & !is.na(x)] <- iconv(x[is.na(parsed) & !is.na(x)], from = "Latin1", to = "ASCII//TRANSLIT")
|
parsed[is.na(parsed) & !is.na(x)] <- iconv(x[is.na(parsed) & !is.na(x)], from = "Latin1", to = "ASCII//TRANSLIT")
|
||||||
parsed <- gsub('"', "", parsed, fixed = TRUE)
|
parsed <- gsub('"', "", parsed, fixed = TRUE)
|
||||||
parsed <- gsub(" +", " ", parsed, perl = TRUE)
|
parsed <- gsub(" +", " ", parsed, perl = TRUE)
|
||||||
parsed <- trimws(parsed)
|
parsed <- trimws(parsed)
|
||||||
|
class(parsed) <- x_class
|
||||||
|
parsed
|
||||||
}, error = function(e) stop(e$message, call. = FALSE)) # this will also be thrown when running `as.mo(no_existing_object)`
|
}, error = function(e) stop(e$message, call. = FALSE)) # this will also be thrown when running `as.mo(no_existing_object)`
|
||||||
parsed
|
parsed
|
||||||
}
|
}
|
||||||
|
@ -747,7 +747,9 @@ mo_validate <- function(x, property, language, ...) {
|
|||||||
find_mo_col <- function(fn) {
|
find_mo_col <- function(fn) {
|
||||||
# this function tries to find an mo column in the data the function was called in,
|
# this function tries to find an mo column in the data the function was called in,
|
||||||
# which is useful when functions are used within dplyr verbs
|
# which is useful when functions are used within dplyr verbs
|
||||||
df <- get_current_data(arg_name = "x", call = -3) # will return an error if not found
|
df <- get_current_data(arg_name = "x",
|
||||||
|
call = -3,
|
||||||
|
reuse_from_1st_call = FALSE) # will return an error if not found
|
||||||
mo <- NULL
|
mo <- NULL
|
||||||
try({
|
try({
|
||||||
mo <- suppressMessages(search_type_in_df(df, "mo"))
|
mo <- suppressMessages(search_type_in_df(df, "mo"))
|
||||||
|
15
R/plot.R
15
R/plot.R
@ -287,6 +287,11 @@ ggplot.mic <- function(data,
|
|||||||
ggplot2::labs(title = title, x = xlab, y = ylab, subtitle = cols_sub$sub)
|
ggplot2::labs(title = title, x = xlab, y = ylab, subtitle = cols_sub$sub)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @method autoplot mic
|
||||||
|
#' @rdname plot
|
||||||
|
# will be exported using s3_register() in R/zzz.R
|
||||||
|
autoplot.mic <- ggplot.mic
|
||||||
|
|
||||||
#' @method plot disk
|
#' @method plot disk
|
||||||
#' @export
|
#' @export
|
||||||
#' @importFrom graphics barplot axis mtext legend
|
#' @importFrom graphics barplot axis mtext legend
|
||||||
@ -506,6 +511,11 @@ ggplot.disk <- function(data,
|
|||||||
ggplot2::labs(title = title, x = xlab, y = ylab, subtitle = cols_sub$sub)
|
ggplot2::labs(title = title, x = xlab, y = ylab, subtitle = cols_sub$sub)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @method autoplot disk
|
||||||
|
#' @rdname plot
|
||||||
|
# will be exported using s3_register() in R/zzz.R
|
||||||
|
autoplot.disk <- ggplot.disk
|
||||||
|
|
||||||
#' @method plot rsi
|
#' @method plot rsi
|
||||||
#' @export
|
#' @export
|
||||||
#' @importFrom graphics plot text axis
|
#' @importFrom graphics plot text axis
|
||||||
@ -657,6 +667,11 @@ ggplot.rsi <- function(data,
|
|||||||
ggplot2::theme(legend.position = "none")
|
ggplot2::theme(legend.position = "none")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @method autoplot rsi
|
||||||
|
#' @rdname plot
|
||||||
|
# will be exported using s3_register() in R/zzz.R
|
||||||
|
autoplot.rsi <- ggplot.rsi
|
||||||
|
|
||||||
plot_prepare_table <- function(x, expand) {
|
plot_prepare_table <- function(x, expand) {
|
||||||
x <- x[!is.na(x)]
|
x <- x[!is.na(x)]
|
||||||
stop_if(length(x) == 0, "no observations to plot", call = FALSE)
|
stop_if(length(x) == 0, "no observations to plot", call = FALSE)
|
||||||
|
118
R/proportion.R
118
R/proportion.R
@ -167,12 +167,14 @@ resistance <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "R",
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = "R",
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -181,12 +183,14 @@ susceptibility <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("S", "I"),
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = c("S", "I"),
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -195,12 +199,14 @@ proportion_R <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "R",
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = "R",
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -209,12 +215,14 @@ proportion_IR <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("I", "R"),
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = c("I", "R"),
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -223,12 +231,14 @@ proportion_I <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "I",
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = "I",
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -237,12 +247,14 @@ proportion_SI <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = c("S", "I"),
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = c("S", "I"),
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -251,12 +263,14 @@ proportion_S <- function(...,
|
|||||||
minimum = 30,
|
minimum = 30,
|
||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
only_all_tested = FALSE) {
|
only_all_tested = FALSE) {
|
||||||
rsi_calc(...,
|
tryCatch(
|
||||||
ab_result = "S",
|
rsi_calc(...,
|
||||||
minimum = minimum,
|
ab_result = "S",
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
only_all_tested = only_all_tested,
|
as_percent = as_percent,
|
||||||
only_count = FALSE)
|
only_all_tested = only_all_tested,
|
||||||
|
only_count = FALSE),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname proportion
|
#' @rdname proportion
|
||||||
@ -268,13 +282,15 @@ proportion_df <- function(data,
|
|||||||
as_percent = FALSE,
|
as_percent = FALSE,
|
||||||
combine_SI = TRUE,
|
combine_SI = TRUE,
|
||||||
combine_IR = FALSE) {
|
combine_IR = FALSE) {
|
||||||
rsi_calc_df(type = "proportion",
|
tryCatch(
|
||||||
data = data,
|
rsi_calc_df(type = "proportion",
|
||||||
translate_ab = translate_ab,
|
data = data,
|
||||||
language = language,
|
translate_ab = translate_ab,
|
||||||
minimum = minimum,
|
language = language,
|
||||||
as_percent = as_percent,
|
minimum = minimum,
|
||||||
combine_SI = combine_SI,
|
as_percent = as_percent,
|
||||||
combine_IR = combine_IR,
|
combine_SI = combine_SI,
|
||||||
combine_SI_missing = missing(combine_SI))
|
combine_IR = combine_IR,
|
||||||
|
combine_SI_missing = missing(combine_SI)),
|
||||||
|
error = function(e) stop_(e$message, call = -5))
|
||||||
}
|
}
|
||||||
|
@ -351,20 +351,6 @@ plot.resistance_predict <- function(x, main = paste("Resistance Prediction of",
|
|||||||
col = "grey40")
|
col = "grey40")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#' @method ggplot resistance_predict
|
|
||||||
#' @rdname resistance_predict
|
|
||||||
# will be exported using s3_register() in R/zzz.R
|
|
||||||
ggplot.resistance_predict <- function(x,
|
|
||||||
main = paste("Resistance Prediction of", x_name),
|
|
||||||
ribbon = TRUE,
|
|
||||||
...) {
|
|
||||||
x_name <- paste0(ab_name(attributes(x)$ab), " (", attributes(x)$ab, ")")
|
|
||||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
|
||||||
meet_criteria(ribbon, allow_class = "logical", has_length = 1)
|
|
||||||
ggplot_rsi_predict(x = x, main = main, ribbon = ribbon, ...)
|
|
||||||
}
|
|
||||||
|
|
||||||
#' @rdname resistance_predict
|
#' @rdname resistance_predict
|
||||||
#' @export
|
#' @export
|
||||||
ggplot_rsi_predict <- function(x,
|
ggplot_rsi_predict <- function(x,
|
||||||
@ -407,3 +393,21 @@ ggplot_rsi_predict <- function(x,
|
|||||||
colour = "grey40")
|
colour = "grey40")
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @method ggplot resistance_predict
|
||||||
|
#' @rdname resistance_predict
|
||||||
|
# will be exported using s3_register() in R/zzz.R
|
||||||
|
ggplot.resistance_predict <- function(x,
|
||||||
|
main = paste("Resistance Prediction of", x_name),
|
||||||
|
ribbon = TRUE,
|
||||||
|
...) {
|
||||||
|
x_name <- paste0(ab_name(attributes(x)$ab), " (", attributes(x)$ab, ")")
|
||||||
|
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||||
|
meet_criteria(ribbon, allow_class = "logical", has_length = 1)
|
||||||
|
ggplot_rsi_predict(x = x, main = main, ribbon = ribbon, ...)
|
||||||
|
}
|
||||||
|
|
||||||
|
#' @method autoplot resistance_predict
|
||||||
|
#' @rdname resistance_predict
|
||||||
|
# will be exported using s3_register() in R/zzz.R
|
||||||
|
autoplot.resistance_predict <- ggplot.resistance_predict
|
||||||
|
6
R/rsi.R
6
R/rsi.R
@ -349,7 +349,7 @@ as.rsi.mic <- function(x,
|
|||||||
|
|
||||||
# for dplyr's across()
|
# for dplyr's across()
|
||||||
cur_column_dplyr <- import_fn("cur_column", "dplyr", error_on_fail = FALSE)
|
cur_column_dplyr <- import_fn("cur_column", "dplyr", error_on_fail = FALSE)
|
||||||
if (!is.null(cur_column_dplyr) && tryCatch(is.data.frame(get_current_data("ab", 0)), error = function(e) FALSE)) {
|
if (!is.null(cur_column_dplyr) && tryCatch(is.data.frame(get_current_data("ab", call = 0, reuse_from_1st_call = FALSE)), error = function(e) FALSE)) {
|
||||||
# try to get current column, which will only be available when in across()
|
# try to get current column, which will only be available when in across()
|
||||||
ab <- tryCatch(cur_column_dplyr(),
|
ab <- tryCatch(cur_column_dplyr(),
|
||||||
error = function(e) ab)
|
error = function(e) ab)
|
||||||
@ -438,7 +438,7 @@ as.rsi.disk <- function(x,
|
|||||||
|
|
||||||
# for dplyr's across()
|
# for dplyr's across()
|
||||||
cur_column_dplyr <- import_fn("cur_column", "dplyr", error_on_fail = FALSE)
|
cur_column_dplyr <- import_fn("cur_column", "dplyr", error_on_fail = FALSE)
|
||||||
if (!is.null(cur_column_dplyr) && tryCatch(is.data.frame(get_current_data("ab", 0)), error = function(e) FALSE)) {
|
if (!is.null(cur_column_dplyr) && tryCatch(is.data.frame(get_current_data("ab", call = 0, reuse_from_1st_call = FALSE)), error = function(e) FALSE)) {
|
||||||
# try to get current column, which will only be available when in across()
|
# try to get current column, which will only be available when in across()
|
||||||
ab <- tryCatch(cur_column_dplyr(),
|
ab <- tryCatch(cur_column_dplyr(),
|
||||||
error = function(e) ab)
|
error = function(e) ab)
|
||||||
@ -448,7 +448,7 @@ as.rsi.disk <- function(x,
|
|||||||
mo_var_found <- ""
|
mo_var_found <- ""
|
||||||
if (is.null(mo)) {
|
if (is.null(mo)) {
|
||||||
tryCatch({
|
tryCatch({
|
||||||
df <- get_current_data(arg_name = "mo", call = -3) # will return an error if not found
|
df <- get_current_data(arg_name = "mo", call = -3, reuse_from_1st_call = FALSE) # will return an error if not found
|
||||||
mo <- NULL
|
mo <- NULL
|
||||||
try({
|
try({
|
||||||
mo <- suppressMessages(search_type_in_df(df, "mo"))
|
mo <- suppressMessages(search_type_in_df(df, "mo"))
|
||||||
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
4
R/zzz.R
4
R/zzz.R
@ -65,6 +65,10 @@ if (utf8_supported && !is_latex) {
|
|||||||
s3_register("ggplot2::ggplot", "mic")
|
s3_register("ggplot2::ggplot", "mic")
|
||||||
s3_register("ggplot2::ggplot", "disk")
|
s3_register("ggplot2::ggplot", "disk")
|
||||||
s3_register("ggplot2::ggplot", "resistance_predict")
|
s3_register("ggplot2::ggplot", "resistance_predict")
|
||||||
|
s3_register("ggplot2::autoplot", "rsi")
|
||||||
|
s3_register("ggplot2::autoplot", "mic")
|
||||||
|
s3_register("ggplot2::autoplot", "disk")
|
||||||
|
s3_register("ggplot2::autoplot", "resistance_predict")
|
||||||
|
|
||||||
# if mo source exists, fire it up (see mo_source())
|
# if mo source exists, fire it up (see mo_source())
|
||||||
try({
|
try({
|
||||||
|
Binary file not shown.
28
data-raw/exploratory_data_analysis_test.R
Normal file
28
data-raw/exploratory_data_analysis_test.R
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
library(dplyr)
|
||||||
|
example_isolates %>%
|
||||||
|
select(mo, where(is.rsi)) %>%
|
||||||
|
tidyr::pivot_longer(cols = where(is.rsi)) %>%
|
||||||
|
# remove intrisic R
|
||||||
|
filter(!paste(mo, name) %in% AMR:::INTRINSIC_R) %>%
|
||||||
|
mutate(name = as.ab(name),
|
||||||
|
value = ifelse(value == "R", 1, 0),
|
||||||
|
class = ab_group(name)) %>%
|
||||||
|
group_by(mo, class) %>%
|
||||||
|
summarise(n = n(),
|
||||||
|
res = mean(value, na.rm = TRUE)) %>%
|
||||||
|
filter(n > 30, !is.na(res))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
df <- example_isolates
|
||||||
|
search_mo <- "B_ESCHR_COLI"
|
||||||
|
intrinsic_res <- INTRINSIC_R[INTRINSIC_R %like% search_mo]
|
||||||
|
intrinsic_res <- gsub(".* (.*)", "\\1", intrinsic_res)
|
||||||
|
|
||||||
|
x <- df %>%
|
||||||
|
select(mo, where(is.rsi)) %>%
|
||||||
|
filter(mo == search_mo) %>%
|
||||||
|
# at least 30 results available
|
||||||
|
select(function(x) sum(!is.na(x)) >= 30) %>%
|
||||||
|
# remove intrisic R
|
||||||
|
select(!matches(paste(intrinsic_res, collapse = "|")))
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
|
<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.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -187,12 +187,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
</header><script src="datasets_files/header-attrs-2.8/header-attrs.js"></script><div class="row">
|
</header><script src="datasets_files/header-attrs-2.7/header-attrs.js"></script><div class="row">
|
||||||
<div class="col-md-9 contents">
|
<div class="col-md-9 contents">
|
||||||
<div class="page-header toc-ignore">
|
<div class="page-header toc-ignore">
|
||||||
<h1 data-toc-skip>Data sets for download / own use</h1>
|
<h1 data-toc-skip>Data sets for download / own use</h1>
|
||||||
|
|
||||||
<h4 class="date">05 June 2021</h4>
|
<h4 class="date">14 June 2021</h4>
|
||||||
|
|
||||||
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/datasets.Rmd"><code>vignettes/datasets.Rmd</code></a></small>
|
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/master/vignettes/datasets.Rmd"><code>vignettes/datasets.Rmd</code></a></small>
|
||||||
<div class="hidden name"><code>datasets.Rmd</code></div>
|
<div class="hidden name"><code>datasets.Rmd</code></div>
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -213,7 +213,7 @@
|
|||||||
<a href="#with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="anchor"></a>With <code>AMR</code> (for R), there’s always a knowledgeable microbiologist by your side!</h5>
|
<a href="#with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="anchor"></a>With <code>AMR</code> (for R), there’s always a knowledgeable microbiologist by your side!</h5>
|
||||||
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
|
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R"><span class="co"># AMR works great with dplyr, but it's not required or neccesary</span>
|
<code class="sourceCode R"><span class="co"># AMR works great with dplyr, but it's not required or neccesary</span>
|
||||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span>
|
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/msberends/AMR">AMR</a></span><span class="op">)</span>
|
||||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||||
|
|
||||||
<span class="va">example_isolates</span> <span class="op">%>%</span>
|
<span class="va">example_isolates</span> <span class="op">%>%</span>
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -236,19 +236,24 @@
|
|||||||
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="amr-1719001" class="section level1">
|
<div id="amr-1719002" class="section level1">
|
||||||
<h1 class="page-header" data-toc-text="1.7.1.9001">
|
<h1 class="page-header" data-toc-text="1.7.1.9002">
|
||||||
<a href="#amr-1719001" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9001</h1>
|
<a href="#amr-1719002" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.7.1.9002</h1>
|
||||||
<div id="last-updated-5-june-2021" class="section level2">
|
<div id="last-updated-14-june-2021" class="section level2">
|
||||||
<h2 class="hasAnchor">
|
<h2 class="hasAnchor">
|
||||||
<a href="#last-updated-5-june-2021" class="anchor"></a><small>Last updated: 5 June 2021</small>
|
<a href="#last-updated-14-june-2021" class="anchor"></a><small>Last updated: 14 June 2021</small>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="changed" class="section level3">
|
<div id="changed" class="section level3">
|
||||||
<h3 class="hasAnchor">
|
<h3 class="hasAnchor">
|
||||||
<a href="#changed" class="anchor"></a>Changed</h3>
|
<a href="#changed" class="anchor"></a>Changed</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Added more antibiotic class selectors, such as <code><a href="../reference/antibiotic_class_selectors.html">lincosamides()</a></code> and <code><a href="../reference/antibiotic_class_selectors.html">lipoglycopeptides()</a></code>
|
<li>Added more antibiotic class selectors: <code><a href="../reference/antibiotic_class_selectors.html">aminopenicillins()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">lincosamides()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">lipoglycopeptides()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">polymyxins()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">quinolones()</a></code>, <code><a href="../reference/antibiotic_class_selectors.html">streptogramins()</a></code> and <code><a href="../reference/antibiotic_class_selectors.html">ureidopenicillins()</a></code>
|
||||||
</li>
|
</li>
|
||||||
|
<li>Added <code><a href="https://ggplot2.tidyverse.org/reference/autoplot.html">ggplot2::autoplot()</a></code> generic for classes <code><mic></code>, <code><disk></code>, <code><rsi></code> and <code><resistance_predict></code>
|
||||||
|
</li>
|
||||||
|
<li>Fix to prevent introducing <code>NA</code>s for old MO codes when running <code><a href="../reference/as.mo.html">as.mo()</a></code> on them</li>
|
||||||
|
<li>Added more informative error messages when any of the <code>proportion_*()</code> and <code>count_*()</code> functions fail</li>
|
||||||
|
<li>Fix for using antibiotic selectors multiple times in one call (e.g., using in <code><a href="https://dplyr.tidyverse.org/reference/filter.html">dplyr::filter()</a></code> and immediately after in <code><a href="https://dplyr.tidyverse.org/reference/select.html">dplyr::select()</a></code>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -302,7 +307,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Function <code><a href="../reference/antibiotic_class_selectors.html">betalactams()</a></code> as additional antbiotic column selector and function <code><a href="../reference/AMR-deprecated.html">filter_betalactams()</a></code> as additional antbiotic column filter. The group of betalactams consists of all carbapenems, cephalosporins and penicillins.</li>
|
<li>Function <code><a href="../reference/antibiotic_class_selectors.html">betalactams()</a></code> as additional antbiotic column selector and function <code><a href="../reference/AMR-deprecated.html">filter_betalactams()</a></code> as additional antbiotic column filter. The group of betalactams consists of all carbapenems, cephalosporins and penicillins.</li>
|
||||||
<li>A <code>ggplot()</code> method for <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>
|
<li>A <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> method for <code><a href="../reference/resistance_predict.html">resistance_predict()</a></code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -403,7 +408,7 @@
|
|||||||
<span class="co">#> Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
|
<span class="co">#> Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
|
||||||
</li>
|
</li>
|
||||||
<li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
|
<li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
|
||||||
<li><p><code>ggplot()</code> generics for classes <code><mic></code> and <code><disk></code></p></li>
|
<li><p><code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> generics for classes <code><mic></code> and <code><disk></code></p></li>
|
||||||
<li>
|
<li>
|
||||||
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
|
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
|
||||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||||
@ -460,7 +465,7 @@
|
|||||||
<li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li>
|
<li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li>
|
||||||
<li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li>
|
<li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li>
|
||||||
<li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li>
|
<li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li>
|
||||||
<li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code>ggplot()</code> on any vector of MIC and disk diffusion values</li>
|
<li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> on any vector of MIC and disk diffusion values</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li>
|
<li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li>
|
||||||
@ -498,7 +503,7 @@
|
|||||||
<a href="#other-1" class="anchor"></a>Other</h3>
|
<a href="#other-1" class="anchor"></a>Other</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Big documentation updates</li>
|
<li>Big documentation updates</li>
|
||||||
<li>Loading the package (i.e., <code><a href="https://msberends.github.io/AMR/">library(AMR)</a></code>) now is ~50 times faster than before, in costs of package size (which increased by ~3 MB)</li>
|
<li>Loading the package (i.e., <code><a href="https://github.com/msberends/AMR">library(AMR)</a></code>) now is ~50 times faster than before, in costs of package size (which increased by ~3 MB)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -629,7 +634,7 @@
|
|||||||
<p>Curious about which enterococci are actually intrinsic resistant to vancomycin?</p>
|
<p>Curious about which enterococci are actually intrinsic resistant to vancomycin?</p>
|
||||||
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R">
|
<code class="sourceCode R">
|
||||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span>
|
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/msberends/AMR">AMR</a></span><span class="op">)</span>
|
||||||
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org">dplyr</a></span><span class="op">)</span>
|
||||||
<span class="va">intrinsic_resistant</span> <span class="op">%>%</span>
|
<span class="va">intrinsic_resistant</span> <span class="op">%>%</span>
|
||||||
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="va">antibiotic</span> <span class="op">==</span> <span class="st">"Vancomycin"</span>, <span class="va">microorganism</span> <span class="op">%like%</span> <span class="st">"Enterococcus"</span><span class="op">)</span> <span class="op">%>%</span>
|
<span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span><span class="op">(</span><span class="va">antibiotic</span> <span class="op">==</span> <span class="st">"Vancomycin"</span>, <span class="va">microorganism</span> <span class="op">%like%</span> <span class="st">"Enterococcus"</span><span class="op">)</span> <span class="op">%>%</span>
|
||||||
|
@ -12,7 +12,7 @@ articles:
|
|||||||
datasets: datasets.html
|
datasets: datasets.html
|
||||||
resistance_predict: resistance_predict.html
|
resistance_predict: resistance_predict.html
|
||||||
welcome_to_AMR: welcome_to_AMR.html
|
welcome_to_AMR: welcome_to_AMR.html
|
||||||
last_built: 2021-06-05T13:10Z
|
last_built: 2021-06-14T20:03Z
|
||||||
urls:
|
urls:
|
||||||
reference: https://msberends.github.io/AMR//reference
|
reference: https://msberends.github.io/AMR//reference
|
||||||
article: https://msberends.github.io/AMR//articles
|
article: https://msberends.github.io/AMR//articles
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -410,6 +410,12 @@ A microorganism is categorised as <em>Susceptible, Increased exposure</em> when
|
|||||||
n2 <span class='op'>=</span> <span class='fu'>n_rsi</span><span class='op'>(</span><span class='va'>CIP</span><span class='op'>)</span>, <span class='co'># same - analogous to n_distinct</span>
|
n2 <span class='op'>=</span> <span class='fu'>n_rsi</span><span class='op'>(</span><span class='va'>CIP</span><span class='op'>)</span>, <span class='co'># same - analogous to n_distinct</span>
|
||||||
total <span class='op'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/context.html'>n</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># NOT the number of tested isolates!</span>
|
total <span class='op'>=</span> <span class='fu'><a href='https://dplyr.tidyverse.org/reference/context.html'>n</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> <span class='co'># NOT the number of tested isolates!</span>
|
||||||
|
|
||||||
|
<span class='co'># Number of available isolates for a whole antibiotic class</span>
|
||||||
|
<span class='co'># (i.e., in this data set columns GEN, TOB, AMK, KAN)</span>
|
||||||
|
<span class='va'>example_isolates</span> <span class='op'>%>%</span>
|
||||||
|
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span><span class='op'>(</span><span class='va'>hospital_id</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||||
|
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise.html'>summarise</a></span><span class='op'>(</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/across.html'>across</a></span><span class='op'>(</span><span class='fu'><a href='antibiotic_class_selectors.html'>aminoglycosides</a></span><span class='op'>(</span><span class='op'>)</span>, <span class='va'>n_rsi</span><span class='op'>)</span><span class='op'>)</span>
|
||||||
|
|
||||||
<span class='co'># Count co-resistance between amoxicillin/clav acid and gentamicin,</span>
|
<span class='co'># Count co-resistance between amoxicillin/clav acid and gentamicin,</span>
|
||||||
<span class='co'># so we can see that combination therapy does a lot more than mono therapy.</span>
|
<span class='co'># so we can see that combination therapy does a lot more than mono therapy.</span>
|
||||||
<span class='co'># Please mind that `susceptibility()` calculates percentages right away instead.</span>
|
<span class='co'># Please mind that `susceptibility()` calculates percentages right away instead.</span>
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -508,7 +508,7 @@
|
|||||||
</tr><tr>
|
</tr><tr>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<p><code><a href="plot.html">plot(<i><mic></i>)</a></code> <code><a href="plot.html">ggplot(<i><mic></i>)</a></code> <code><a href="plot.html">plot(<i><disk></i>)</a></code> <code><a href="plot.html">ggplot(<i><disk></i>)</a></code> <code><a href="plot.html">plot(<i><rsi></i>)</a></code> <code><a href="plot.html">ggplot(<i><rsi></i>)</a></code> </p>
|
<p><code><a href="plot.html">plot(<i><mic></i>)</a></code> <code><a href="plot.html">ggplot(<i><mic></i>)</a></code> <code><a href="plot.html">autoplot(<i><mic></i>)</a></code> <code><a href="plot.html">plot(<i><disk></i>)</a></code> <code><a href="plot.html">ggplot(<i><disk></i>)</a></code> <code><a href="plot.html">autoplot(<i><disk></i>)</a></code> <code><a href="plot.html">plot(<i><rsi></i>)</a></code> <code><a href="plot.html">ggplot(<i><rsi></i>)</a></code> <code><a href="plot.html">autoplot(<i><rsi></i>)</a></code> </p>
|
||||||
</td>
|
</td>
|
||||||
<td><p>Plotting for Classes <code>rsi</code>, <code>mic</code> and <code>disk</code></p></td>
|
<td><p>Plotting for Classes <code>rsi</code>, <code>mic</code> and <code>disk</code></p></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
@ -532,7 +532,7 @@
|
|||||||
</tr><tr>
|
</tr><tr>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<p><code><a href="resistance_predict.html">resistance_predict()</a></code> <code><a href="resistance_predict.html">rsi_predict()</a></code> <code><a href="resistance_predict.html">plot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">ggplot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">ggplot_rsi_predict()</a></code> </p>
|
<p><code><a href="resistance_predict.html">resistance_predict()</a></code> <code><a href="resistance_predict.html">rsi_predict()</a></code> <code><a href="resistance_predict.html">plot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">ggplot_rsi_predict()</a></code> <code><a href="resistance_predict.html">ggplot(<i><resistance_predict></i>)</a></code> <code><a href="resistance_predict.html">autoplot(<i><resistance_predict></i>)</a></code> </p>
|
||||||
</td>
|
</td>
|
||||||
<td><p>Predict antimicrobial resistance</p></td>
|
<td><p>Predict antimicrobial resistance</p></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -258,7 +258,23 @@
|
|||||||
<span class='op'>)</span>
|
<span class='op'>)</span>
|
||||||
|
|
||||||
<span class='co'># S3 method for mic</span>
|
<span class='co'># S3 method for mic</span>
|
||||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span>
|
<span class='fu'>ggplot</span><span class='op'>(</span>
|
||||||
|
<span class='va'>data</span>,
|
||||||
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"MIC values of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
|
ylab <span class='op'>=</span> <span class='st'>"Frequency"</span>,
|
||||||
|
xlab <span class='op'>=</span> <span class='st'>"Minimum Inhibitory Concentration (mg/L)"</span>,
|
||||||
|
mo <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
ab <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
guideline <span class='op'>=</span> <span class='st'>"EUCAST"</span>,
|
||||||
|
colours_RSI <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'>"#ED553B"</span>, <span class='st'>"#3CAEA3"</span>, <span class='st'>"#F6D55C"</span><span class='op'>)</span>,
|
||||||
|
language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>,
|
||||||
|
expand <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||||
|
<span class='va'>...</span>
|
||||||
|
<span class='op'>)</span>
|
||||||
|
|
||||||
|
<span class='co'># S3 method for mic</span>
|
||||||
|
<span class='fu'>autoplot</span><span class='op'>(</span>
|
||||||
<span class='va'>data</span>,
|
<span class='va'>data</span>,
|
||||||
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"MIC values of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"MIC values of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
@ -289,7 +305,23 @@
|
|||||||
<span class='op'>)</span>
|
<span class='op'>)</span>
|
||||||
|
|
||||||
<span class='co'># S3 method for disk</span>
|
<span class='co'># S3 method for disk</span>
|
||||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span>
|
<span class='fu'>ggplot</span><span class='op'>(</span>
|
||||||
|
<span class='va'>data</span>,
|
||||||
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Disk zones of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
|
ylab <span class='op'>=</span> <span class='st'>"Frequency"</span>,
|
||||||
|
xlab <span class='op'>=</span> <span class='st'>"Disk diffusion diameter (mm)"</span>,
|
||||||
|
mo <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
ab <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
guideline <span class='op'>=</span> <span class='st'>"EUCAST"</span>,
|
||||||
|
colours_RSI <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'>"#ED553B"</span>, <span class='st'>"#3CAEA3"</span>, <span class='st'>"#F6D55C"</span><span class='op'>)</span>,
|
||||||
|
language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>,
|
||||||
|
expand <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||||
|
<span class='va'>...</span>
|
||||||
|
<span class='op'>)</span>
|
||||||
|
|
||||||
|
<span class='co'># S3 method for disk</span>
|
||||||
|
<span class='fu'>autoplot</span><span class='op'>(</span>
|
||||||
<span class='va'>data</span>,
|
<span class='va'>data</span>,
|
||||||
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Disk zones of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Disk zones of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
@ -314,7 +346,19 @@
|
|||||||
<span class='op'>)</span>
|
<span class='op'>)</span>
|
||||||
|
|
||||||
<span class='co'># S3 method for rsi</span>
|
<span class='co'># S3 method for rsi</span>
|
||||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span>
|
<span class='fu'>ggplot</span><span class='op'>(</span>
|
||||||
|
<span class='va'>data</span>,
|
||||||
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Overview of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
|
xlab <span class='op'>=</span> <span class='st'>"Antimicrobial Interpretation"</span>,
|
||||||
|
ylab <span class='op'>=</span> <span class='st'>"Frequency"</span>,
|
||||||
|
colours_RSI <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'>"#ED553B"</span>, <span class='st'>"#3CAEA3"</span>, <span class='st'>"#F6D55C"</span><span class='op'>)</span>,
|
||||||
|
language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>,
|
||||||
|
<span class='va'>...</span>
|
||||||
|
<span class='op'>)</span>
|
||||||
|
|
||||||
|
<span class='co'># S3 method for rsi</span>
|
||||||
|
<span class='fu'>autoplot</span><span class='op'>(</span>
|
||||||
<span class='va'>data</span>,
|
<span class='va'>data</span>,
|
||||||
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
mapping <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||||
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Overview of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
title <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Overview of"</span>, <span class='fu'><a href='https://rdrr.io/r/base/deparse.html'>deparse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/substitute.html'>substitute</a></span><span class='op'>(</span><span class='va'>data</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>,
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -275,10 +275,18 @@
|
|||||||
<span class='co'># S3 method for resistance_predict</span>
|
<span class='co'># S3 method for resistance_predict</span>
|
||||||
<span class='fu'><a href='plot.html'>plot</a></span><span class='op'>(</span><span class='va'>x</span>, main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
|
<span class='fu'><a href='plot.html'>plot</a></span><span class='op'>(</span><span class='va'>x</span>, main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||||
|
|
||||||
|
<span class='fu'>ggplot_rsi_predict</span><span class='op'>(</span>
|
||||||
|
<span class='va'>x</span>,
|
||||||
|
main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>,
|
||||||
|
ribbon <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||||
|
<span class='va'>...</span>
|
||||||
|
<span class='op'>)</span>
|
||||||
|
|
||||||
<span class='co'># S3 method for resistance_predict</span>
|
<span class='co'># S3 method for resistance_predict</span>
|
||||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>x</span>, main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>, ribbon <span class='op'>=</span> <span class='cn'>TRUE</span>, <span class='va'>...</span><span class='op'>)</span>
|
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggplot.html'>ggplot</a></span><span class='op'>(</span><span class='va'>x</span>, main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>, ribbon <span class='op'>=</span> <span class='cn'>TRUE</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||||
|
|
||||||
<span class='fu'>ggplot_rsi_predict</span><span class='op'>(</span>
|
<span class='co'># S3 method for resistance_predict</span>
|
||||||
|
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/autoplot.html'>autoplot</a></span><span class='op'>(</span>
|
||||||
<span class='va'>x</span>,
|
<span class='va'>x</span>,
|
||||||
main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>,
|
main <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Resistance Prediction of"</span>, <span class='va'>x_name</span><span class='op'>)</span>,
|
||||||
ribbon <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
ribbon <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
<a class="navbar-link" href="index.html">AMR (for R)</a>
|
||||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9001</span>
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.7.1.9002</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# ==================================================================== #
|
# ==================================================================== #
|
||||||
|
|
||||||
# Check if these function still exist in the package (all are in Suggests field)
|
# Check if these function still exist in the package (all are in Suggests field)
|
||||||
# Since GitHub Action runs every night, we will get emailed when a dependency fails based on this unit test
|
# Since GitHub Actions runs every night, we will get emailed when a dependency fails based on this unit test
|
||||||
# functions used by import_fn()
|
# functions used by import_fn()
|
||||||
import_functions <- c(
|
import_functions <- c(
|
||||||
"anti_join" = "dplyr",
|
"anti_join" = "dplyr",
|
||||||
@ -53,14 +53,23 @@ call_functions <- c(
|
|||||||
# skimr
|
# skimr
|
||||||
"inline_hist" = "skimr",
|
"inline_hist" = "skimr",
|
||||||
"sfl" = "skimr",
|
"sfl" = "skimr",
|
||||||
# set_mo_source
|
# readxl
|
||||||
"read_excel" = "readxl",
|
"read_excel" = "readxl",
|
||||||
# ggplot_rsi
|
# ggplot2
|
||||||
|
"aes" = "ggplot2",
|
||||||
"aes_string" = "ggplot2",
|
"aes_string" = "ggplot2",
|
||||||
|
"arrow" = "ggplot2",
|
||||||
|
"autoplot" = "ggplot2",
|
||||||
"element_blank" = "ggplot2",
|
"element_blank" = "ggplot2",
|
||||||
"element_line" = "ggplot2",
|
"element_line" = "ggplot2",
|
||||||
"element_text" = "ggplot2",
|
"element_text" = "ggplot2",
|
||||||
|
"expand_limits" = "ggplot2",
|
||||||
"facet_wrap" = "ggplot2",
|
"facet_wrap" = "ggplot2",
|
||||||
|
"geom_errorbar" = "ggplot2",
|
||||||
|
"geom_path" = "ggplot2",
|
||||||
|
"geom_point" = "ggplot2",
|
||||||
|
"geom_ribbon" = "ggplot2",
|
||||||
|
"geom_segment" = "ggplot2",
|
||||||
"geom_text" = "ggplot2",
|
"geom_text" = "ggplot2",
|
||||||
"ggplot" = "ggplot2",
|
"ggplot" = "ggplot2",
|
||||||
"labs" = "ggplot2",
|
"labs" = "ggplot2",
|
||||||
@ -70,31 +79,9 @@ call_functions <- c(
|
|||||||
"scale_y_continuous" = "ggplot2",
|
"scale_y_continuous" = "ggplot2",
|
||||||
"theme" = "ggplot2",
|
"theme" = "ggplot2",
|
||||||
"theme_minimal" = "ggplot2",
|
"theme_minimal" = "ggplot2",
|
||||||
# ggplot_pca
|
|
||||||
"aes" = "ggplot2",
|
|
||||||
"arrow" = "ggplot2",
|
|
||||||
"element_blank" = "ggplot2",
|
|
||||||
"element_line" = "ggplot2",
|
|
||||||
"element_text" = "ggplot2",
|
|
||||||
"expand_limits" = "ggplot2",
|
|
||||||
"geom_path" = "ggplot2",
|
|
||||||
"geom_point" = "ggplot2",
|
|
||||||
"geom_segment" = "ggplot2",
|
|
||||||
"geom_text" = "ggplot2",
|
|
||||||
"ggplot" = "ggplot2",
|
|
||||||
"labs" = "ggplot2",
|
|
||||||
"theme" = "ggplot2",
|
|
||||||
"theme_minimal" = "ggplot2",
|
|
||||||
"unit" = "ggplot2",
|
"unit" = "ggplot2",
|
||||||
"xlab" = "ggplot2",
|
"xlab" = "ggplot2",
|
||||||
"ylab" = "ggplot2",
|
"ylab" = "ggplot2"
|
||||||
# resistance_predict
|
|
||||||
"aes" = "ggplot2",
|
|
||||||
"geom_errorbar" = "ggplot2",
|
|
||||||
"geom_point" = "ggplot2",
|
|
||||||
"geom_ribbon" = "ggplot2",
|
|
||||||
"ggplot" = "ggplot2",
|
|
||||||
"labs" = "ggplot2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
import_functions <- c(import_functions, call_functions)
|
import_functions <- c(import_functions, call_functions)
|
||||||
|
@ -168,6 +168,12 @@ if (require("dplyr")) {
|
|||||||
n2 = n_rsi(CIP), # same - analogous to n_distinct
|
n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||||
total = n()) # NOT the number of tested isolates!
|
total = n()) # NOT the number of tested isolates!
|
||||||
|
|
||||||
|
# Number of available isolates for a whole antibiotic class
|
||||||
|
# (i.e., in this data set columns GEN, TOB, AMK, KAN)
|
||||||
|
example_isolates \%>\%
|
||||||
|
group_by(hospital_id) \%>\%
|
||||||
|
summarise(across(aminoglycosides(), n_rsi))
|
||||||
|
|
||||||
# Count co-resistance between amoxicillin/clav acid and gentamicin,
|
# Count co-resistance between amoxicillin/clav acid and gentamicin,
|
||||||
# so we can see that combination therapy does a lot more than mono therapy.
|
# so we can see that combination therapy does a lot more than mono therapy.
|
||||||
# Please mind that `susceptibility()` calculates percentages right away instead.
|
# Please mind that `susceptibility()` calculates percentages right away instead.
|
||||||
|
44
man/plot.Rd
44
man/plot.Rd
@ -4,10 +4,13 @@
|
|||||||
\alias{plot}
|
\alias{plot}
|
||||||
\alias{plot.mic}
|
\alias{plot.mic}
|
||||||
\alias{ggplot.mic}
|
\alias{ggplot.mic}
|
||||||
|
\alias{autoplot.mic}
|
||||||
\alias{plot.disk}
|
\alias{plot.disk}
|
||||||
\alias{ggplot.disk}
|
\alias{ggplot.disk}
|
||||||
|
\alias{autoplot.disk}
|
||||||
\alias{plot.rsi}
|
\alias{plot.rsi}
|
||||||
\alias{ggplot.rsi}
|
\alias{ggplot.rsi}
|
||||||
|
\alias{autoplot.rsi}
|
||||||
\title{Plotting for Classes \code{rsi}, \code{mic} and \code{disk}}
|
\title{Plotting for Classes \code{rsi}, \code{mic} and \code{disk}}
|
||||||
\usage{
|
\usage{
|
||||||
\method{plot}{mic}(
|
\method{plot}{mic}(
|
||||||
@ -39,6 +42,21 @@
|
|||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
|
\method{autoplot}{mic}(
|
||||||
|
data,
|
||||||
|
mapping = NULL,
|
||||||
|
title = paste("MIC values of", deparse(substitute(data))),
|
||||||
|
ylab = "Frequency",
|
||||||
|
xlab = "Minimum Inhibitory Concentration (mg/L)",
|
||||||
|
mo = NULL,
|
||||||
|
ab = NULL,
|
||||||
|
guideline = "EUCAST",
|
||||||
|
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||||
|
language = get_locale(),
|
||||||
|
expand = TRUE,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
|
||||||
\method{plot}{disk}(
|
\method{plot}{disk}(
|
||||||
x,
|
x,
|
||||||
main = paste("Disk zones of", deparse(substitute(x))),
|
main = paste("Disk zones of", deparse(substitute(x))),
|
||||||
@ -68,6 +86,21 @@
|
|||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
|
\method{autoplot}{disk}(
|
||||||
|
data,
|
||||||
|
mapping = NULL,
|
||||||
|
title = paste("Disk zones of", deparse(substitute(data))),
|
||||||
|
ylab = "Frequency",
|
||||||
|
xlab = "Disk diffusion diameter (mm)",
|
||||||
|
mo = NULL,
|
||||||
|
ab = NULL,
|
||||||
|
guideline = "EUCAST",
|
||||||
|
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||||
|
language = get_locale(),
|
||||||
|
expand = TRUE,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
|
||||||
\method{plot}{rsi}(
|
\method{plot}{rsi}(
|
||||||
x,
|
x,
|
||||||
ylab = "Percentage",
|
ylab = "Percentage",
|
||||||
@ -86,6 +119,17 @@
|
|||||||
language = get_locale(),
|
language = get_locale(),
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
|
\method{autoplot}{rsi}(
|
||||||
|
data,
|
||||||
|
mapping = NULL,
|
||||||
|
title = paste("Resistance Overview of", deparse(substitute(data))),
|
||||||
|
xlab = "Antimicrobial Interpretation",
|
||||||
|
ylab = "Frequency",
|
||||||
|
colours_RSI = c("#ED553B", "#3CAEA3", "#F6D55C"),
|
||||||
|
language = get_locale(),
|
||||||
|
...
|
||||||
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x, data}{MIC values created with \code{\link[=as.mic]{as.mic()}} or disk diffusion values created with \code{\link[=as.disk]{as.disk()}}}
|
\item{x, data}{MIC values created with \code{\link[=as.mic]{as.mic()}} or disk diffusion values created with \code{\link[=as.disk]{as.disk()}}}
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
\alias{resistance_predict}
|
\alias{resistance_predict}
|
||||||
\alias{rsi_predict}
|
\alias{rsi_predict}
|
||||||
\alias{plot.resistance_predict}
|
\alias{plot.resistance_predict}
|
||||||
\alias{ggplot.resistance_predict}
|
|
||||||
\alias{ggplot_rsi_predict}
|
\alias{ggplot_rsi_predict}
|
||||||
|
\alias{ggplot.resistance_predict}
|
||||||
|
\alias{autoplot.resistance_predict}
|
||||||
\title{Predict antimicrobial resistance}
|
\title{Predict antimicrobial resistance}
|
||||||
\usage{
|
\usage{
|
||||||
resistance_predict(
|
resistance_predict(
|
||||||
@ -40,9 +41,16 @@ rsi_predict(
|
|||||||
|
|
||||||
\method{plot}{resistance_predict}(x, main = paste("Resistance Prediction of", x_name), ...)
|
\method{plot}{resistance_predict}(x, main = paste("Resistance Prediction of", x_name), ...)
|
||||||
|
|
||||||
|
ggplot_rsi_predict(
|
||||||
|
x,
|
||||||
|
main = paste("Resistance Prediction of", x_name),
|
||||||
|
ribbon = TRUE,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
|
||||||
\method{ggplot}{resistance_predict}(x, main = paste("Resistance Prediction of", x_name), ribbon = TRUE, ...)
|
\method{ggplot}{resistance_predict}(x, main = paste("Resistance Prediction of", x_name), ribbon = TRUE, ...)
|
||||||
|
|
||||||
ggplot_rsi_predict(
|
\method{autoplot}{resistance_predict}(
|
||||||
x,
|
x,
|
||||||
main = paste("Resistance Prediction of", x_name),
|
main = paste("Resistance Prediction of", x_name),
|
||||||
ribbon = TRUE,
|
ribbon = TRUE,
|
||||||
|
Loading…
Reference in New Issue
Block a user