mirror of
https://github.com/msberends/AMR.git
synced 2024-12-26 05:26:13 +01:00
git update
This commit is contained in:
parent
0e1fdb7dd7
commit
00447c6dc4
@ -324,7 +324,7 @@ warning_ <- function(...,
|
|||||||
# - adds the function name where the error was thrown
|
# - adds the function name where the error was thrown
|
||||||
# - wraps text to never break lines within words
|
# - wraps text to never break lines within words
|
||||||
stop_ <- function(..., call = TRUE) {
|
stop_ <- function(..., call = TRUE) {
|
||||||
msg <- word_wrap(..., add_fn = list(), as_note = FALSE)
|
msg <- paste0(c(...), collapse = "")
|
||||||
if (!isFALSE(call)) {
|
if (!isFALSE(call)) {
|
||||||
if (isTRUE(call)) {
|
if (isTRUE(call)) {
|
||||||
call <- as.character(sys.call(-1)[1])
|
call <- as.character(sys.call(-1)[1])
|
||||||
@ -334,6 +334,7 @@ stop_ <- function(..., call = TRUE) {
|
|||||||
}
|
}
|
||||||
msg <- paste0("in ", call, "(): ", msg)
|
msg <- paste0("in ", call, "(): ", msg)
|
||||||
}
|
}
|
||||||
|
msg <- word_wrap(msg, add_fn = list(), as_note = FALSE)
|
||||||
stop(msg, call. = FALSE)
|
stop(msg, call. = FALSE)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,6 +410,7 @@ dataset_UTF8_to_ASCII <- function(df) {
|
|||||||
df
|
df
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# for eucast_rules() and mdro(), creates markdown output with URLs and names
|
||||||
create_ab_documentation <- function(ab) {
|
create_ab_documentation <- function(ab) {
|
||||||
ab_names <- ab_name(ab, language = NULL, tolower = TRUE)
|
ab_names <- ab_name(ab, language = NULL, tolower = TRUE)
|
||||||
ab <- ab[order(ab_names)]
|
ab <- ab[order(ab_names)]
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
|
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
|
||||||
#'
|
#'
|
||||||
#' ### Why this is so important
|
#' ### 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
|
#' ### `filter_*()` shortcuts
|
||||||
#'
|
#'
|
||||||
@ -60,6 +60,7 @@
|
|||||||
#'
|
#'
|
||||||
#' ```
|
#' ```
|
||||||
#' x[first_isolate(x, ...), ]
|
#' x[first_isolate(x, ...), ]
|
||||||
|
#'
|
||||||
#' x %>% filter(first_isolate(x, ...))
|
#' x %>% filter(first_isolate(x, ...))
|
||||||
#' ```
|
#' ```
|
||||||
#'
|
#'
|
||||||
|
Loading…
Reference in New Issue
Block a user