mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 18:01:50 +02:00
(v0.7.1.90012) mo_shortname fix
This commit is contained in:
@ -151,9 +151,14 @@ mo_shortname <- function(x, language = get_locale(), ...) {
|
||||
x.mo <- AMR::as.mo(x, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
replace_empty <- function(x) {
|
||||
x[x == ""] <- "spp."
|
||||
x
|
||||
}
|
||||
|
||||
# get first char of genus and complete species in English
|
||||
shortnames <- paste0(substr(mo_genus(x.mo, language = NULL), 1, 1), ". ", mo_species(x.mo, language = NULL))
|
||||
|
||||
shortnames <- paste0(substr(mo_genus(x.mo, language = NULL), 1, 1), ". ", replace_empty(mo_species(x.mo, language = NULL)))
|
||||
|
||||
# exceptions for Staphylococci
|
||||
shortnames[shortnames == "S. coagulase-negative" ] <- "CoNS"
|
||||
shortnames[shortnames == "S. coagulase-positive" ] <- "CoPS"
|
||||
|
Reference in New Issue
Block a user