Get or set document-level meta-data. Document-level meta-data are a special type of docvars, meant to contain information about documents that would not be used as a "variable" for analysis. An example could be the source of the document, or notes pertaining to its transformation, copyright information, etc.
Document-level meta-data differs from corpus-level meta-data in that the latter pertains to the collection of texts as a whole, whereas the document-level version can differ with each document.
metadoc(x, field = NULL)metadoc(x, field = NULL) <- value
a corpus object
character, the name of the metadata field(s) to be queried or set
the new value of the new meta-data field
For texts
, a character vector of the texts in the corpus.
For texts <-
, the corpus with the updated texts.
# NOT RUN {
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