swap_cols: Swap columns in a data frame

Description Usage Arguments Value Examples

View source: R/asymmetrise.R

Description

Swap columns .x and .y in df.

Usage

1
swap_cols(df, .x, .y)

Arguments

df

a data.frame (or tibble) object

.x, .y

column names to switch

Value

a data.frame (or tibble) object with .x and .y swapped

Examples

1
2
3
4
5
6
7
8
df <- data.frame(
  a = c("A", "B"),
  b = c("C", "D"),
  untouched = c(1, 2)
)
df

swap_cols(df, a, b)

jhrcook/ggasym documentation built on July 12, 2021, 3:27 a.m.