1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 07:41:57 +02:00

(v1.5.0.9012) ampc_cephalosporin_resistance for I

This commit is contained in:
2021-01-25 21:58:00 +01:00
parent 24eb4453db
commit 331c1f6508
19 changed files with 73 additions and 35 deletions

11
R/mo.R
View File

@ -2016,3 +2016,14 @@ repair_reference_df <- function(reference_df) {
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE])
reference_df
}
strip_words <- function(text, n, side = "right") {
out <- lapply(strsplit(x, " "), function(x) {
if (side %like% "^r" & length(x) > n) {
x[seq_len(length(x) - n)]
} else if (side %like% "^l" & length(x) > n) {
x[2:length(x)]
}
})
vapply(FUN.VALUE = character(1), out, paste, collapse = " ")
}