#' This function allows you to clean vector text
#'
#' @param x Vecteur le corpus a cleaner
#' @export
cleantext = function(x) {
tolower(x) %>%
iconv(., to = "ASCII//TRANSLIT") %>%
str_replace_all(., "d'|l'", " ") %>%
str_replace_all(., c("tous", "tout", "a", "lesquels",
"lequel", "lesquelles", "plus",
"ca" ,"car", "trop", "moins",
"si", "sait", "bien", "elle", "ou",
"elles", "etre", "comment",
stopwords("fr")[-34]) %>%
paste(collapse = "\\b|\\b") %>%
paste0("\\b", ., "\\b"), "") %>%
str_replace_all(., "[[:punct:]]+", " ") %>%
str_replace_all(., "s |s$", " ") %>%
str_replace_all(., "\\s+", " ") %>%
trimws()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.