white | R Documentation |
The function white
collapse all multiple "spaces" in a single space.
By default the function identifies a white space by \s+
which is
a shortcut for [^[:space:]]
i.e. tab, newline, vertical tab, form
feed, carriage return, space and possibly other locale-dependent characters.
There is option to override the pattern to be use to identify white spaces.
white(corpus, ..., pattern = "\\s+") ## S3 method for class 'list' white(corpus, ..., pattern = NULL) ## S3 method for class 'character' white(corpus, ..., pattern = NULL) ## S3 method for class 'VCorpus' white(corpus, ..., pattern = NULL) ## Default S3 method: white(corpus, ..., pattern = NULL)
corpus |
a compatible object storing documents (actually, list (and
corpus-list of (tokened) documents,
character vectors and |
... |
Other paramenter |
pattern |
(chr) A regular expression to be use for detection of
withespace. If |
an object of the same class of input with documents witten with trimmed whitespaces.
data(liu_corpus) white(c(' one two three ')) white(liu_corpus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.