Learn R Programming

quanteda (version 3.3.1)

summary_metadata: Functions to add or retrieve corpus summary metadata

Description

Functions to add or retrieve corpus summary metadata

Usage

add_summary_metadata(x, extended = FALSE, ...)

get_summary_metadata(x, ...)

summarize_texts_extended(x, stop_words = stopwords("en"), n = 100)

Value

add_summary_metadata() returns a corpus with summary metadata added as a data.frame, with the top-level list element names summary.

get_summary_metadata() returns the summary metadata as a data.frame.

summarize_texts_extended() returns extended summary information.

Arguments

x

corpus object

...

additional arguments passed to tokens() when computing the summary information

Details

This is provided so that a corpus object can be stored with summary information to avoid having to compute this every time [summary.corpus()] is called.

So in future calls, if !is.null(meta(x, "summary", type = "system") && !length(list(...)), then summary.corpus() will simply return get_system_meta() rather than compute the summary statistics on the fly, which requires tokenizing the text.