[R] generating factors from the edit function
izahn at psych.rochester.edu
Sat Mar 5 05:42:21 CET 2011
I would set up the data.frame the way you want it before calling
fix(). Something like
test2df <- data.frame(v1=numeric(), v2=factor())
test2df <- fix(test2df)
On Sat, Mar 5, 2011 at 4:34 AM, Erin Hodgess <erinm.hodgess at gmail.com> wrote:
> 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")
> '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!
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: erinm.hodgess at gmail.com
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
University of Rochester
Department of Clinical and Social Psychology
More information about the R-help