str_clean: Remove punctuation and/or accent from a string

View source: R/str_clean.R

str_cleanR Documentation

Remove punctuation and/or accent from a string

Description

Remove punctuation and/or accent from a string.

Usage

str_clean(string, remove_accent = TRUE, remove_punct = TRUE, sub_punct = "")

Arguments

string

A character vector

remove_accent

A boolean value, if TRUE the function will remove accent symbols from the string (default = TRUE)

remove_punct

A boolean value, if TRUE the function will remove punctuation symbols from the string (default = TRUE)

sub_punct

A character single value (default = ”), that will be replacement for the punctuation symbols

Value

A character vector.

Examples


string <- "a..;éâ...íõ"

#remove only punctuation
str_clean(string,remove_accent = FALSE,remove_punct = TRUE)

#remove only accent
str_clean(string,remove_accent = TRUE,remove_punct = FALSE)

#remove both
str_clean(string)

vbfelix/relper documentation built on Jan. 28, 2025, 12:15 p.m.