Printed a ready-to-paste mutate() call recoding a set of factor columns via
forcats::fct_recode() – unrelated to cross-tabulation, and unused elsewhere in tabxplor.
Removed in 2.1.0; copy it into your own project if you rely on it.
Usage
fct_recode_helper(
data,
.cols = -where(is.numeric),
name_in,
name_out,
freq = NULL,
style = c("mutate", "base"),
reminder = TRUE,
cat = TRUE
)Arguments
- data
The data frame.
- .cols
<tidy-select> The variables to recode.
- name_in
The input data frame's name (default: the expression given as
data).- name_out
The output data frame's name, if different from
name_in.- freq
Print each level's frequency and count as a comment; defaults to
TRUEwhen 5 or fewer variables are given.- style
"mutate"(default) writes adplyr::mutate()call;"base"writesdata$var <-.- reminder
Print a
"new" = "old"syntax reminder. DefaultTRUE.- cat
Print to console, or open a temporary file when there are more than 5 variables;
FALSEreturns a data frame of the recode text instead.