Learn R Programming

quanteda (version 0.9.8.5)

metacorpus: get or set corpus metadata

Description

Get or set the corpus-level metadata in a quanteda corpus object.

Usage

metacorpus(x, field = NULL)
"metacorpus"(x, field = NULL)
metacorpus(x, field) <- value

Arguments

x
A quanteda corpus object
field
Metadata field name(s). If NULL (default), return all metadata names.
value
new value of the corpus metadata field

Value

For metacorpus, a list of the metadata fields in the corpus. If a list is not what you wanted, you can wrap the results in unlist, but this will remove any metadata field that is set to NULL.For metacorpus <-, the corpus with the updated metadata.

Examples

Run this code
metacorpus(inaugCorpus)
metacorpus(inaugCorpus, "source")
metacorpus(inaugCorpus, "citation") <- "Presidential Speeches Online Project (2014)."
metacorpus(inaugCorpus, "citation")

Run the code above in your browser using DataLab