removeNumbers: Remove Numbers from a Text Document

Description Usage Arguments Value See Also Examples

View source: R/transform.R

Description

Remove numbers from a text document.

Usage

1
2
3
4
## S3 method for class 'character'
removeNumbers(x, ucp = FALSE, ...)
## S3 method for class 'PlainTextDocument'
removeNumbers(x, ...)

Arguments

x

a character vector or text document.

ucp

a logical specifying whether to use Unicode character properties for determining digit characters. If FALSE (default), characters in the ASCII [:digit:] class (i.e., the decimal digits from 0 to 9) are taken; if TRUE, the characters with Unicode general category Nd (Decimal_Number).

...

arguments to be passed to or from methods; in particular, from the PlainTextDocument method to the character method.

Value

The text document without numbers.

See Also

getTransformations to list available transformation (mapping) functions.

http://unicode.org/reports/tr44/#General_Category_Values.

Examples

1
2
3
data("crude")
crude[[1]]
removeNumbers(crude[[1]])

Example output

Loading required package: NLP
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 527
<<PlainTextDocument>>
Metadata:  15
Content:  chars: 520

tm documentation built on July 11, 2020, 3 a.m.