summary.corpus: Summarize a corpus

View source: R/summary.R

summary.corpusR Documentation

Summarize a corpus

Description

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

Usage

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

Arguments

object

corpus to be summarized

n

maximum number of texts to describe, default=100

tolower

convert texts to lower case before counting types

showmeta

set to TRUE to include document-level meta-data

...

additional arguments passed through to tokens()

Examples

summary(data_corpus_inaugural)
summary(data_corpus_inaugural, n = 10)
corp <- corpus(data_char_ukimmig2010,
               docvars = data.frame(party=names(data_char_ukimmig2010)))
summary(corp, showmeta = TRUE) # show the meta-data
sumcorp <- summary(corp) # (quietly) assign the results
sumcorp$Types / sumcorp$Tokens # crude type-token ratio

quanteda documentation built on Sept. 11, 2024, 6:08 p.m.