mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 11:51:59 +02:00
(v0.8.0.9009) unit test
This commit is contained in:
2
R/age.R
2
R/age.R
@ -133,6 +133,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) {
|
||||
#' # same:
|
||||
#' age_groups(ages, c(1, 2, 4, 6, 13, 17))
|
||||
#'
|
||||
#' \dontrun{
|
||||
#' # resistance of ciprofloxacine per age group
|
||||
#' library(dplyr)
|
||||
#' example_isolates %>%
|
||||
@ -141,6 +142,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) {
|
||||
#' group_by(age_group = age_groups(age)) %>%
|
||||
#' select(age_group, CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
#' }
|
||||
age_groups <- function(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) {
|
||||
if (!is.numeric(x)) {
|
||||
stop("`x` and must be numeric, not a ", paste0(class(x), collapse = "/"), ".")
|
||||
|
@ -99,7 +99,9 @@
|
||||
#' example_isolates %>%
|
||||
#' select(AMX) %>%
|
||||
#' ggplot_rsi(colours = c(SI = "yellow"))
|
||||
#'
|
||||
#'
|
||||
#' \dontrun{
|
||||
#'
|
||||
#' # resistance of ciprofloxacine per age group
|
||||
#' example_isolates %>%
|
||||
#' mutate(first_isolate = first_isolate(.)) %>%
|
||||
@ -110,8 +112,7 @@
|
||||
#' select(age_group,
|
||||
#' CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
#' \donttest{
|
||||
#'
|
||||
#'
|
||||
#' # for colourblind mode, use divergent colours from the viridis package:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
|
1
R/mdro.R
1
R/mdro.R
@ -25,7 +25,6 @@
|
||||
#' @param guideline a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, see Details.
|
||||
#' @param info print progress
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param verbose print additional info: missing antibiotic columns per parameter
|
||||
#' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate.
|
||||
#' @param verbose a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
|
||||
#' @inheritSection eucast_rules Antibiotics
|
||||
|
Reference in New Issue
Block a user