[R] integer and character conversion

Gabor Grothendieck ggrothendieck at gmail.com
Sun Aug 23 12:42:46 CEST 2009


Its not being stored as an integer.  Its being stored as a double.
If it were stored as an integer you would not get the e:

> as.character(1000000000L)
[1] "1000000000"
> as.character(as.integer(1000000000))
[1] "1000000000"


On Sat, Aug 22, 2009 at 7:13 PM, Dajiang J. Liu<dajiang.liu at gmail.com> wrote:
> Dear all,I want to convert a long integer to a string, and for example,
> 100000000
> I used as.character(1000000000) e.g, and it gives me back 1e+???. What I
> want is a exact form, not exponential form. Any ideas how to do it? Thank
> you very much.
> Regards,
> Dajiang
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list