ReplaceBlank <- function(x, replacement = '_'){
if(!require(stringr)) {install.packages('stringr'); library(stringr)}
x <- str_replace_all(x, '^[[:blank:]]|[[:blank:]]$', '') # Removing leading and trailing space
x <- str_replace_all(x, '[[:blank:]]{1,}', replacement)
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.