Learn R Programming

quanteda (version 0.9.9-50)

metadoc: get or set document-level meta-data

Description

Get or set the document-level meta-data.

Usage

metadoc(x, field = NULL)

metadoc(x, field = NULL) <- value

Arguments

x
a corpus object
field
character, the name of the metadata field(s) to be queried or set
value
the new value of the new meta-data field

Value

For texts, a character vector of the texts in the corpus.

For texts <-, the corpus with the updated texts.

Examples

Run this code
mycorp <- corpus_subset(data_corpus_inaugural, Year > 1990)
summary(mycorp, showmeta = TRUE)
metadoc(mycorp, "encoding") <- "UTF-8"
metadoc(mycorp)
metadoc(mycorp, "language") <- "english"
summary(mycorp, showmeta = TRUE)

Run the code above in your browser using DataLab