[R] Very confused with class

2008-08-21 Thread Williams, Robin
Hi all, I am very confused with class. I am looking at some weather data which I want to use as explanatory variables in an lm. R has treated these variables as factors (i.e. with different levels), whereas I want them treated as discretely measured continuous variables. So I need to reassign t

Re: [R] Very confused with class

2008-08-21 Thread Mark Lyman
Williams, Robin metoffice.gov.uk> writes: > > Hi all, > I am very confused with class. > I am looking at some weather data which I want to use as explanatory > variables in an lm. R has treated these variables as factors (i.e. with > different levels), whereas I want them treated as discrete

Re: [R] Very confused with class

2008-08-21 Thread Prof Brian Ripley
This seems to be FAQ Q7.10 On Thu, 21 Aug 2008, Williams, Robin wrote: Hi all, I am very confused with class. I am looking at some weather data which I want to use as explanatory variables in an lm. R has treated these variables as factors (i.e. with different levels), whereas I want them tre

Re: [R] Very confused with class

2008-08-21 Thread Dan Davison
Hi Robin, You haven't said where you're getting the data from. But if the answer is that you're using read.table, read.csv or similar to read the data into R, then I advise you to go back to that stage and get it right from the outset. It's very, very common to see people who are relatively new to

Re: [R] Very confused with class

2008-08-21 Thread Dan Davison
helping matters. I don't even > understand why R is interpreting these figures as factors in the first > place, doesn't this imply that any similar data would be interpreted as > factors? > Thanks for any further help. > Robin Williams > Met Office summer intern - He

Re: [R] Very confused with class

2008-08-21 Thread Richard M. Heiberger
Dan, The real problem is the use of csv files. csv files don't handle missing values ("#VALUE" is most likely from Excel), dates, or other complications very well. Read your Excel file directly into R with one of the packages designed specifically for that purpose. I recommend RExcel (Windows o

Re: [R] Very confused with class

2008-08-22 Thread Dan Davison
Hi Rich, Richard M. Heiberger wrote: > > Dan, > > The real problem is the use of csv files. csv files don't handle missing > values > ("#VALUE" is most likely from Excel), dates, or other complications very > well. > > Read your Excel file directly into > R with one of the packages designed