R/clean_text.R

Defines functions clean_text

Documented in clean_text

#' Clean/standardize text
#'
#' Removes punctuation and spaces from character string. Also makes it lower case.
#' @param string a character string to "clean"
#' @return the cleaned character string (no punctuation, spaces or capital letters)
#' @examples
#' clean_text("HELLO_World!!!")
#' @export
#' @seealso \link{best_match}
clean_text <- function(string) tolower(gsub("[^[:alnum:]]", "", string))

Try the rccmisc package in your browser

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

rccmisc documentation built on May 2, 2019, 2:48 p.m.