Learn R Programming

faux (version 1.2.1)

add_recode: Recode a categorical column

Description

Recode a categorical column

Usage

add_recode(.data, .col, .newcol = paste0(col, ".c"), ...)

Value

data frame with new fixed effects columns

Arguments

.data

the data frame

.col

the column to recode

.newcol

the name of the recoded column (defaults to col.c)

...

coding for categorical column

Examples

Run this code
add_random(subj = 4, item = 4) %>%
  add_between("subj", cond = c("cntl", "test")) %>%
  add_recode("cond", "cond.t", cntl = 0, test = 1)

Run the code above in your browser using DataLab