[R] "Re: Change class factor to numeric"

Arantzazu Blanco Bernardeau aramucia at hotmail.com
Tue May 18 17:36:57 CEST 2010



sorry I had a mistake sending my question without a subject. I do resend again. Please excuse me.
> Hello
> I have a data array with soil variables (caperf), in which the variable "clay" is factor (as I see entering str(caperf)) . I need to do a regression model, so I need to have arcilla (=clay) as a numeric variable.  For that I have entered
>
> as.numeric(as.character(arcilla))
>
> and even entering
> 'as.numeric(levels(arcilla))[arcilla]'the variable is resting as factor, and the linear model is not valid (for my purposes).
> The decimal commas have been converted to decimal points, so I have no idea of what to do.
> Thanks a lot
>
>
> Arantzazu Blanco Bernardeau
> Dpto de Química Agrícola, Geología y Edafología
> Universidad de Murcia-Campus de Espinardo
>
>
>
>
>
>
> _________________________________________________________________
> Diseñar aplicaciones tiene premio. ¡Si eres desarrollador no esperes más!
> http://www.imaginemobile.es
 		 	   		  
_________________________________________________________________
Recibe en tu HOTMAIL los emails de TODAS tus CUENTAS. + info



More information about the R-help mailing list