Learn R Programming

quanteda.tidy (version 0.4)

relocate.corpus: Change column order of document variables

Description

Use relocate() to change the column positions of document variables, using the same syntax as select() to make it easy to move blocks of columns at once.

Usage

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

Value

A corpus with document variables reordered.

Arguments

.data

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details.

...

<tidy-select> Columns to move.

Examples

Run this code
data_corpus_inaugural %>%
  relocate(President, Party) %>%
  summary(n = 5)

data_corpus_inaugural %>%
  relocate(FirstName, President, .before = Year) %>%
  summary(n = 5)

Run the code above in your browser using DataLab