fac2char: Convert all factors in a data frame to character vectors

View source: R/data_manip_utils.R

fac2charR Documentation

Convert all factors in a data frame to character vectors

Description

This is useful when you forgot to specify stringsAsFactors = FALSE when creating your data frame.

Usage

fac2char(df)

Arguments

df

The data frame in which fo convert factors.

Value

df, with all factor columns converted to character vectors.

See Also

as.character(), data.frame()

Examples


x <- data.frame(letters, 1:26, LETTERS)
sapply(x, class)
x2 <- fac2char(x)
sapply(x2, class)


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.