removePunctuation

0th

Percentile

Remove Punctuation Marks from a Text Document

Remove punctuation marks from a text document.

Usage
"removePunctuation"(x, preserve_intra_word_dashes = FALSE) "removePunctuation"(x, ...)
Arguments
x
A character or text document.
preserve_intra_word_dashes
a logical specifying whether intra-word dashes should be kept.
...
passed over argument preserve_intra_word_dashes.
Value

The character or text document x without punctuation marks (besides intra-word dashes if preserve_intra_word_dashes is set).

See Also

getTransformations to list available transformation (mapping) functions.

regex shows the class [:punct:] of punctuation characters.

Aliases
  • removePunctuation
  • removePunctuation.character
  • removePunctuation.PlainTextDocument
Examples
data("crude")
crude[[14]]
removePunctuation(crude[[14]])
removePunctuation(crude[[14]], preserve_intra_word_dashes = TRUE)
Documentation reproduced from package tm, version 0.6-2, License: GPL-3

Community examples

chanchalsheik@gmail.com at Nov 12, 2017 tm v0.7-1

#install.packages("tm") #library(tm) #REMOVE PUNCTUATION # mydatac is the name of the data column tm_map(mydatac, removePunctuation)