df_reorder: Reorder the columns of a data frame

View source: R/df_reorder.R

df_reorderR Documentation

Reorder the columns of a data frame

Description

Reorder the columns of a data frame

Usage

df_reorder(df, columns, after)

Arguments

df

the data frame

columns

the column(s) to move (either as character names or numeric indices)

after

the column after which to insert columns (must be a scalar, either a character name or a numeric index)

Value

The reordered data frame

Examples

df <- data.frame(a = 1:10, b = 11:20, c = 21:30, d = 31:40)
df_reorder(df, 2:3, "d")
df_reorder(df, c("c", "d"), "a")

paulhibbing/PAutilities documentation built on Sept. 12, 2022, 1:46 a.m.