char_cols: Convert all columns in a data.frame to character

Description Usage Arguments Author(s)

Description

R's tendency to convert strings to factors is well meaning, but occasionally annoying when munging data (e.g. when using rbind, or dplyr's bind_rows). char_cols turns all variables in a data.frame into character variables. Optionally, if all is set to FALSE, only factor variables will be converted.

Usage

1

Arguments

x

A data.frame

all

Should all the columns (not just those of factors) be converted to character?

Author(s)

Brendan Rocks rocks.brendan@gmail.com


brendan-r/brocks documentation built on May 13, 2019, 5:08 a.m.