char2fac: Convert non-numeric columns to factors

Description Usage Arguments Examples

View source: R/char2fac.R

Description

Converts all non-numeric columns in a data frame to factors.

Usage

1

Arguments

x

A data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Example data frame
d <- data.frame(
  x = 1:3, 
  y = letters[1:3], 
  z = c(TRUE, TRUE, FALSE), 
  stringsAsFactors = FALSE
)

# Check column types with `col_types()`
col_types(d)
col_types(char2fac(d))

bgreenwell/bmisc documentation built on Sept. 24, 2019, 11:09 a.m.