transform_cols: Column transformer

Description Usage Arguments Examples

View source: R/convert.R

Description

Convert columns to a target class.

Usage

1
transform_cols(data, cols, transformer, ...)

Arguments

data

Data to convert.

cols

Character vector with columns to convert.

transformer

A quoted function name that applies the conversion, e.g. "as.numeric".

...

Arguments passed to the transformer.

Examples

1
2
3
mtcars %>%
  transform_cols("vs", "readr::parse_factor", levels = 0:1) %>%
  transform_cols("vs", "forcats::fct_recode", low = "0", high = "1")

lorenzwalthert/simplificar documentation built on May 7, 2019, 9:32 a.m.