[R] Integer vs numeric

Christophe Genolini cgenolin at u-paris10.fr
Mon Jan 28 23:51:21 CET 2008


> Further to the above: The help
>
>   ?":"
>
> says:
>
> Value:
>   For numeric arguments [as opposed to factors],
>   a numeric vector. This will be of type 'integer'
>   if 'from' and 'to' are both integers and
>   representable in the integer type, otherwise of
>   type 'numeric'
???

This is very surprising since with a "to" numeric, the result is integer :

 > str(1:4.5)
 int [1:4] 1 2 3 4

Anyway, if I understand, 'integer' in R is not realy the math type 
integer. I am a bit confuse...

Christophe



More information about the R-help mailing list