Hi all,

I repeatedly encounter the following problem: After importing a data set into a data frame, I wish to set a column with numeric values to be a factor, but can't figure out how to do this. Also, I do not wish to write as.factor(x) all the time. I can create a new vector with x <- factor(x), but the new vector resides outside the attached data frame.

Pascal

> attach(ngrad)
> is.factor(STNW)
[1] FALSE

> ngrad$STNW<-factor(STNW)  ## doesn't work
> is.factor(STNW)
[1] FALSE

> is.factor(STNW) <- T    ## doesn't work either
Error: couldn't find function "is.factor<-"

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to