R/replace_white.R

Defines functions replace_white

Documented in replace_white

#' Remove Escaped Characters
#' 
#' Pre-process data to replace one or more white space character with a single 
#' space.
#' 
#' @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)
}

Try the textclean package in your browser

Any scripts or data that you put into this service are public.

textclean documentation built on May 2, 2019, 7:22 a.m.