#' Reduce consecutive, internal whitespace characters (not leading or trailing) to a single whitespace character
#'
#' @param x A chacter vector
#'
#' @return modified vector where serial whitespace characters have been replaced with a single whitespace character (the first in the series)
#' @export
#'
#' @examples
#' reducews("CCN 51")
#' @seealso [stringr:::str_squish()] which does essentially the same thing
reducews <- function(x){
gsub("(\\s)\\s+","\\1",x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.