R/replace_white.R

Defines functions replace_white

Documented in replace_white

#' Remove White Space Characters
#' 
#' Pre-process data to replace one or more white space character with a single 
#' space (this includes new line characters).
#' 
#' @param x The character vector.
#' @param \dots ignored.
#' @return Returns a vector of character strings with escaped characters removed.
#' @keywords escaped character
#' @export
#' @examples
#' x <- "I go \r
#'     to   the \tnext line"
#' x
#' replace_white(x)
replace_white <- function(x, ...) {
    gsub("\\s+", " ",  x)
}
trinker/textmod documentation built on Nov. 3, 2021, 7:20 p.m.