[R] Making a data frame into a factor ?

Paul Lynch plynchnlm at gmail.com
Wed Apr 16 03:36:11 CEST 2008


Hi,
   I'm trying to do a linear regression style one-way ANOVA using some
data in a data frame, and (perhaps because I am still relatively
unfamiliar with both R and statistics) what I thought I should do was
to make the data frame into a factor.  By that I mean that I have a
data frame whose column labels are the levels of the factor, and the
values in the frame are numeric values for the dependent variable.
   I can construct the relevant vectors by hand, if I have to (and I
guess I will start in that direction) but I am sure there must be 1-3
line bit of R that could elegantly create the factor and the vector of
values.
   Thanks in advance,

-- 
Paul Lynch
Aquilent, Inc.
National Library of Medicine (Contractor)



More information about the R-help mailing list