[R] How to avoid automatic coercion to factor?

Dutky, Steve steve.dutky at thomson.com
Wed Sep 3 00:30:15 CEST 2003

I have a function that manipulates a list of numeric and character
components of equal length and wants to return a data.frame.


f<-function() { 

How can I get the columns Char1, Char2, (...CharN) returned coerced to
character and not factor?

It appears that I could coerce individual columns by
b$CharI<-as.character(b$CharI). Is there a less ugly way of doing this?

Thanks, Steve Dutky
301-545-4113 desk
301-325-8146 cell
steve.dutky at thomson.com

More information about the R-help mailing list