forked from quanteda/quanteda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadoc.Rd
52 lines (47 loc) · 1.56 KB
/
metadoc.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docvars.R
\name{metadoc}
\alias{metadoc}
\alias{metadoc<-}
\title{Get or set document-level meta-data}
\usage{
metadoc(x, field = NULL)
metadoc(x, field = NULL) <- value
}
\arguments{
\item{x}{a \link{corpus} object}
\item{field}{character, the name of the metadata field(s) to be queried or
set}
\item{value}{the new value of the new meta-data field}
}
\value{
For \code{texts}, a character vector of the texts in the corpus.
For \code{texts <-}, the corpus with the updated texts.
}
\description{
Get or set document-level meta-data. Document-level meta-data are a special
type of \link{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.
}
\note{
Document-level meta-data names are preceded by an underscore character,
such as \code{_language}, but when named in in the \code{field} argument,
do \emph{not} need the underscore character.
}
\examples{
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)
}
\seealso{
\code{\link{metacorpus}}
}
\keyword{corpus}