relocate.corpus: Change column order of document variables

View source: R/relocate.R

relocate.corpusR Documentation

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 class 'corpus'
relocate(.data, ...)

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

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

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

quanteda/quanteda.tidy documentation built on April 5, 2025, 2:50 p.m.