Learn R Programming

quanteda (version 0.7.2-1)

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(corp, field = NULL)

metadoc(corp, field = NULL) <- value

Arguments

corp
A quanteda corpus object
field
string containing 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