Learn R Programming

quanteda (version 0.99)

summary.corpus: summarize a corpus

Description

Displays information about a corpus, including includes attributes and metadata such as date of number of texts, creation and source.

Usage

# S3 method for corpus
summary(object, n = 100, verbose = TRUE,
  showmeta = FALSE, tolower = FALSE, ...)

Arguments

object

corpus to be summarized

n

maximum number of texts to describe, default=100

verbose

set to FALSE to turn off printed output, for instance if you simply want to assign the output to a data.frame

showmeta

set to TRUE to include document-level meta-data

tolower

convert texts to lower case before counting types

...

additional arguments passed through to tokenize

Examples

Run this code
# NOT RUN {
summary(data_corpus_inaugural)
summary(data_corpus_inaugural, n=10)
mycorpus <- corpus(data_char_ukimmig2010, 
                   docvars = data.frame(party=names(data_char_ukimmig2010))) 
summary(mycorpus, showmeta=TRUE)  # show the meta-data
mysummary <- summary(mycorpus, verbose=FALSE)  # (quietly) assign the results
mysummary$Types / mysummary$Tokens             # crude type-token ratio
# }

Run the code above in your browser using DataLab