1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 04:46:11 +01:00

git update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-11-28 22:15:44 +01:00
parent 0e1fdb7dd7
commit 00447c6dc4
2 changed files with 5 additions and 2 deletions

View File

@ -324,7 +324,7 @@ warning_ <- function(...,
# - adds the function name where the error was thrown
# - wraps text to never break lines within words
stop_ <- function(..., call = TRUE) {
msg <- word_wrap(..., add_fn = list(), as_note = FALSE)
msg <- paste0(c(...), collapse = "")
if (!isFALSE(call)) {
if (isTRUE(call)) {
call <- as.character(sys.call(-1)[1])
@ -334,6 +334,7 @@ stop_ <- function(..., call = TRUE) {
}
msg <- paste0("in ", call, "(): ", msg)
}
msg <- word_wrap(msg, add_fn = list(), as_note = FALSE)
stop(msg, call. = FALSE)
}
@ -409,6 +410,7 @@ dataset_UTF8_to_ASCII <- function(df) {
df
}
# for eucast_rules() and mdro(), creates markdown output with URLs and names
create_ab_documentation <- function(ab) {
ab_names <- ab_name(ab, language = NULL, tolower = TRUE)
ab <- ab[order(ab_names)]

View File

@ -50,7 +50,7 @@
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
#'
#' ### Why this is so important
#' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [(ref)](https:/pubmed.ncbi.nlm.nih.gov/17304462/). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all *S. aureus* isolates would be overestimated, because you included this MRSA more than once. It would be [selection bias](https://en.wikipedia.org/wiki/Selection_bias).
#' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [(Hindler *et al.* 2007)](https://pubmed.ncbi.nlm.nih.gov/17304462/). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all *S. aureus* isolates would be overestimated, because you included this MRSA more than once. It would be [selection bias](https://en.wikipedia.org/wiki/Selection_bias).
#'
#' ### `filter_*()` shortcuts
#'
@ -60,6 +60,7 @@
#'
#' ```
#' x[first_isolate(x, ...), ]
#'
#' x %>% filter(first_isolate(x, ...))
#' ```
#'