Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

text_stats

Text Statistics


Description

Report descriptive statistics for a set of texts.

Usage

text_stats(x, filter = NULL, ...)

Arguments

x

a text corpus.

filter

if non-NULL, a text filter to to use instead of the default text filter for x.

...

additional properties to set on the text filter.

Details

text_stats reports descriptive statistics for a set of texts: the number of tokens, unique types, and sentences.

Value

A data frame with columns named tokens, types, and sentences, with one row for each text.

See Also

Examples

text_stats(c("A rose is a rose is a rose.",
             "A Rose is red. A violet is blue!"))

corpus

Text Corpus Analysis

v0.10.2
Apache License (== 2.0) | file LICENSE
Authors
Leslie Huang [cre, ctb], Patrick O. Perry [aut, cph], Finn Årup Nielsen [cph, dtc] (AFINN Sentiment Lexicon), Martin Porter and Richard Boulton [ctb, cph, dtc] (Snowball Stemmer and Stopword Lists), The Regents of the University of California [ctb, cph] (Strtod Library Procedure), Carlo Strapparava and Alessandro Valitutti [cph, dtc] (WordNet-Affect Lexicon), Unicode, Inc. [cph, dtc] (Unicode Character Database)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.