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:
11
R/mo.R
11
R/mo.R
@ -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 = " ")
|
||||
}
|
||||
|
Reference in New Issue
Block a user