recode: Recode labelled columns

View source: R/edar_eda.R

recodeR Documentation

Recode labelled columns

Description

This function recode labelled columns

Usage

recode(
  df,
  var,
  newvar = var,
  newvar_label = NULL,
  missing = NULL,
  recode,
  sep = " / "
)

Arguments

df

a data frame

var

a string with the name of the variable in the data frame to be recoded

newvar

a string with the name of the new variable that will receive the recoded columns. By default, it uses the original variable (var)

newvar_label

string with the label for the new variable

recode

a named vector. The names are the code of the labels in the old variable. The values are the new values

sep

a string to use to separate labels when joining values during the recoding

Value

It returns a tibble data frame with recoded column


DiogoFerrari/edar documentation built on May 8, 2022, 8:26 a.m.