[R] generating factors from the edit function

Erin Hodgess erinm.hodgess at gmail.com
Sat Mar 5 05:34:50 CET 2011


Dear R People:

If I use the fix or edit function for a new data frame, I would like
to have my character data as factors.

Is there a "built in" way to do this, please?

Here is what I did:

> test2.df <- data.frame()
> test2.df <- fix(test2.df,factor.mode="character")
> str(test2.df)
'data.frame':   5 obs. of  2 variables:
 $ var1: num  1 2 3 4 5
 $ var2: chr  "a" "a" "g" "g" ...
>
The character data is simply that.  I would like create factors when I
enter character data.

Thank you!

Sincerely,

Erin


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com



More information about the R-help mailing list