Learn R Programming

quanteda (version 0.7.2-1)

subset.corpus: extract a subset of a corpus

Description

Works just like the normal subset command but for corpus objects

Usage

## S3 method for class 'corpus':
subset(x, subset = NULL, select = NULL, ...)

Arguments

x
corpus object to be subsetted.
subset
logical expression indicating elements or rows to keep: missing values are taken as false.
select
expression, indicating the attributes to select from the corpus
...
additional arguments affecting the summary produced

Value

  • corpus object

Examples

Run this code
summary(subset(inaugCorpus, Year>1980))
summary(subset(inaugCorpus, Year>1930 & President=="Roosevelt", select=Year))

Run the code above in your browser using DataLab