getMeanWordLength <- function(text) {
words <- str_split(text, " ")
word_lengths <- lapply(words, str_length)[[1]]
return(mean(word_lengths))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.