> -----Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of PtitBleu
> Sent: Wednesday, February 09, 2011 4:15 AM
> To: r-help@r-project.org
> Subject: [R] Problem with long number (from character to numeric class)
> 
> 
> Hello,
> 
> I have a text file with one column containing long number but stored as
> string.
> I download the file with read.table (and colClass) and the first row of
> this
> column is :
> 
> "095842087016731010"
> 
> As I need to make some calculations with these numbers, I tried to convert
> them using as.numeric.
> But then I get
> as.numeric("095842087016731010")
> 95842087016731008
> 
> I understand the disappearing of the first 0 but I don't understand the
> substitution of the last 0 by 8.
> 
> Is there a way to avoid that ?
> Thanks in advance,

What kind of processing do you need to do with these numbers?  There may be 
better ways to handle the problem.

Dan

Daniel Nordlund
Bothell, WA USA

______________________________________________
R-help@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.

Reply via email to