Closed ablaette closed 1 year ago
Make function more generic and independent from polmineR: Should be a function with character vector as input that drops all characters not allowed.
charfilter <- function(x, chars){ vocab <- lapply( strsplit(x, ""), function(x) paste(ifelse(x %in% chars, x, ""), collapse = "") ) unlist(vocab, recursive = FALSE) }
Concerning naming: CharFilter is common in Spark, and Django.
Make function more generic and independent from polmineR: Should be a function with character vector as input that drops all characters not allowed.