R/clean.R

Defines functions clean

Documented in clean

#' Remove Escaped Characters
#' 
#' Preprocess data to remove escaped characters
#' 
#' @param text.var The text variable
#' @return Returns a vector of character strings with escaped characters removed.
#' @keywords escaped character
#' @export
#' @examples
#' \dontrun{
#' x <- "I go \\r
#'     to the \\tnext line"
#' x
#' clean(x)
#' }
clean <-
function(text.var) {
    gsub("\\s+", " ", gsub("\\\\r|\\\\n|\\n|\\\\t", " ", text.var))
}
trinker/qdap documentation built on Sept. 30, 2020, 6:28 p.m.