forked from quanteda/quanteda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorpus_subset.Rd
36 lines (33 loc) · 1.13 KB
/
corpus_subset.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/corpus_subset.R
\name{corpus_subset}
\alias{corpus_subset}
\title{Extract a subset of a corpus}
\usage{
corpus_subset(x, subset, select, ...)
}
\arguments{
\item{x}{\link{corpus} object to be subsetted}
\item{subset}{logical expression indicating the documents to keep: missing
values are taken as false}
\item{select}{expression, indicating the \link{docvars} to keep}
\item{...}{not used}
}
\value{
corpus object, with a subset of documents (and docvars) selected according to arguments
}
\description{
Returns subsets of a corpus that meet certain conditions, including direct
logical operations on docvars (document-level variables). \code{corpus_subset}
functions identically to \code{\link{subset.data.frame}}, using non-standard
evaluation to evaluate conditions based on the \link{docvars} in the corpus.
}
\examples{
summary(corpus_subset(data_corpus_inaugural, Year > 1980))
summary(corpus_subset(data_corpus_inaugural, Year > 1930 & President == "Roosevelt",
select = Year))
}
\seealso{
\code{\link{subset.data.frame}}
}
\keyword{corpus}