[R] Changing integer class

Christophe Genolini cgenolin at u-paris10.fr
Sat Jul 7 12:52:49 CEST 2007


Hi all

I define a function with two methods, one for numeric or integer. 
Sometime, I need the numeric method to be applied on integer. So I try 
to change the class of the integer but it does not work... Does someone 
know why ?

>  x<-1:3
>  class(x)
[1] "integer"
>  class(x)<- "numeric"
>  class(x)
[1] "integer"

Thanks

Christophe



More information about the R-help mailing list