summary.corpus: Summarize a corpus

Description Usage Arguments Examples

View source: R/corpus-methods-base.R

Description

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

Usage

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

Arguments

object

corpus to be summarized

n

maximum number of texts to describe, default=100

showmeta

set to TRUE to include document-level meta-data

tolower

convert texts to lower case before counting types

...

additional arguments passed through to tokens

Examples

1
2
3
4
5
6
7
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/quanteda documentation built on Feb. 16, 2019, 5:45 a.m.