select.corpus: Subset docvars using their names and types

Description Usage Arguments Details Examples

View source: R/select.R

Description

Select (and optionally rename) document variables in a data frame, using a concise mini-language that makes it easy to refer to variables based on their name (e.g. a:f selects all columns from a on the left to f on the right). You can also use predicate functions like is.numeric to select variables based on their properties.

Usage

1
2
## S3 method for class 'corpus'
select(.data, ...)

Arguments

.data

a quanteda object with document variables

...

<tidy-select> One or more unquoted expressions separated by commas. Variable names can be used as if they were positions in the data frame, so expressions like x:y can be used to select a range of variables.

Details

For an overview of selection features, see dplyr::select().

Examples

1
2
3
data_corpus_inaugural %>%
  select(Party, Year) %>%
  summary(n = 5)

quanteda/quanteda.tidy documentation built on April 11, 2021, 3:44 p.m.