[R] Change class factor to numeric

From: Smit, R. (Robin) (IenT) <robin.smit_at_tno.nl>
Date: Fri 06 May 2005 - 21:37:25 EST


I am attempting to develop a multiple regression model using selected model variables that should all be treated as numeric (mostly real) values.
However, R considers one specific variable "mass" automatically to be of class "factor", probably because "mass" consists of integer values that are repeated.
I now want to force R to treat "mass" as a numeric variable in the regression but am not sure how to do this.
 

> class(mass) <- "numeric"
 

does not help me.  

Could anyone advise me on this?  

Kind regards,
Robin Smit



TNO Science & Technology

Business Unit Automotive
Environmental Studies & Testing
PO Box 6033, 2600 JA Delft
THE NETHERLANDS ph. +31 (0)15 269 7464
fax +31 (0)15 269 6874
robin.smit@tno.nl
http://www.tno.nl/industrie_en_techniek/mobiliteit_en_(transport)/milieu studies/environmental_studies_and/
<http://www.tno.nl/industrie_en_techniek/mobiliteit_en_(transport)/milie ustudies/environmental_studies_and/>


 

This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 06 21:47:01 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:37 EST