Learn R Programming

labelr (version 0.1.9)

fact2char: Convert All Factor Variables of a Data Frame to Character Variables

Description

Convenience function to convert all factor variables to character.

Usage

fact2char(data)

f2c(data)

Value

a data.frame identical to data, with exception that any factors have been converted to character variables.

Arguments

data

a data.frame object.

Examples

Run this code
sapply(iris, class)
head(iris)

iris_ch <- fact2char(iris)

sapply(iris_ch, class)
head(iris_ch)

Run the code above in your browser using DataLab