mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 11:11:54 +02:00
(v1.5.0.9001) more informative argument errors
This commit is contained in:
8
R/ab.R
8
R/ab.R
@ -82,6 +82,14 @@
|
||||
#' # they use as.ab() internally:
|
||||
#' ab_name("J01FA01") # "Erythromycin"
|
||||
#' ab_name("eryt") # "Erythromycin"
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#'
|
||||
#' # you can quickly rename <rsi> columns using dplyr >= 1.0.0:
|
||||
#' example_isolates %>%
|
||||
#' rename_with(as.ab, where(is.rsi))
|
||||
#'
|
||||
#' }
|
||||
as.ab <- function(x, flag_multiple_results = TRUE, info = TRUE, ...) {
|
||||
meet_criteria(x, allow_class = c("character", "numeric", "integer", "factor"), allow_NA = TRUE)
|
||||
meet_criteria(flag_multiple_results, allow_class = "logical", has_length = 1)
|
||||
|
Reference in New Issue
Block a user