Erin Hodgess-2 wrote: > > Here is a little function that I put together: > >> fact1 > function(x) { > n <- ncol(x) > for(i in 1:n) { > if(mode(x[,i])=="character")x[,i] <- factor(x[,i]) > } > return(x) > } >> > > See
http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg22459.html for a more R-ish approach. I find the d[] <- an FFQ (frequently forgotten solution) Dieter -- View this message in context: http://r.789695.n4.nabble.com/generating-factors-from-the-edit-function-tp3336273p3336455.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.