mutate_all_types: Mutate all columns with 'utils::type.convert()'.'

View source: R/utils.R

mutate_all_typesR Documentation

Mutate all columns with utils::type.convert().'

Description

Turns factors into characters and numerics where possible.

Usage

mutate_all_types(dat)

Arguments

dat

data.frame to convert

Value

data.frame with no factors

Author(s)

Kelly Sovacool, sovacool@umich.edu

Examples

## Not run: 
dat <- data.frame(
  c1 = as.factor(c("a", "b", "c")),
  c2 = as.factor(1:3)
)
class(dat$c1)
class(dat$c2)
dat <- mutate_all_types(dat)
class(dat$c1)
class(dat$c2)

## End(Not run)

SchlossLab/mikropml documentation built on Aug. 24, 2023, 9:51 p.m.