Skip to contents

Rename columns in a dataframe using a function or a custom renaming function.

Usage

step_rename(x, .cols = everything(), .fn = NULL, snapshot_data = FALSE)

Arguments

x

A survey tibble.

.cols

Columns to rename. Can use tidyselect syntax. Defaults to all columns.

.fn

A function that takes a character string (the current name) and returns a character string (the new name). If NULL, a default function is used.

snapshot_data

Logical. If TRUE, a snapshot of the data is taken. If FALSE, snapshot without data is taken. If NULL, no snapshot is taken.

Examples

if (FALSE) { # \dontrun{
data("srv_example", package = "g6tr.survey")
x <- srv_example |> 
  step_rename(starts_with("s_"), .fn = toupper)
  
get_lineage(x, 0, "info")
} # }