#' countSpaces
#'
#' Count the number of spaces in a string
#' @param s string to count spaces
#' @return return the count of spaces
#' @export
countSpaces <- function(s) {
sapply(gregexpr(" ", s), function(p) { sum(p>=0) } )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.