Learn R Programming

eeptools (version 0.3.1)

defac: convert a factor to a character string safely

Description

This is a shortcut function to convert a factor to a character variable without having to type as.character()

Usage

defac(x)

Arguments

x
a factor to be turned into a character

Value

  • a character string of the vector input

See Also

factor, levels to understand the R implementation of factors.

Examples

Run this code
a<-as.factor(LETTERS)
summary(a)
b<-defac(a)
class(b)

Run the code above in your browser using DataLab