allow column name for ab in as.sir()

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2024-05-20 21:29:13 +02:00
1 parent fc269e667d
commit d214f74e25
10 files changed
+139 -106

No files matched your search

+4
View File
@@ -129,6 +129,10 @@ ab_from_text <- function(text,
text_split_all <- text_split_all[nchar(text_split_all) >= 4 & grepl("[a-z]+", text_split_all)]
result <- lapply(text_split_all, function(text_split) {
progress$tick()
text_split <- text_split[text_split %like% "[A-Z]" & text_split %unlike% "[0-9]"]
if (length(text_split) == 0) {
return(as.ab(NA_character_))
}
suppressWarnings(
as.ab(text_split, ...)
)