Learn R Programming

quanteda.tidy (version 0.4)

arrange.corpus: Arrange the document order of a corpus by variables

Description

Order the documents in a corpus by variables, including document variables.

Usage

# S3 method for corpus
arrange(.data, ...)

Value

A corpus with documents reordered according to the specified variables.

Arguments

.data

a corpus object whose documents will be sorted

...

comma-separated list of unquoted document variables, or expressions involving document variables. Use desc to sort a variable in descending order.

Examples

Run this code
arrange(data_corpus_inaugural[1:5], President)
arrange(data_corpus_inaugural[1:5], c(3, 2, 1, 5, 4))
arrange(data_corpus_inaugural[1:5], desc(President))

Run the code above in your browser using DataLab