Learn R Programming

quanteda (version 0.9.7-17)

metadoc: get or set document-level meta-data

Description

Get or set the document-level meta-data, including reserved fields for language and corpus.

Usage

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

Arguments

x
A quanteda 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 <- subset(inaugCorpus, 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