Use colClasses argument in read.table to set the class of column:

For a file with two columns, where the first is string and the other is
numeric:

read.table('your_file.dat', colClasses = c('character', 'numeric'))

On Wed, Aug 12, 2009 at 1:43 PM, Andrew C <acarr...@gmail.com> wrote:

>
> Hi,
>
> I have a text (.dat) file, in which each row contains several long numeric
> strings.  One of the strings is 38 digits long, for example:
>
> 03200801200801172008011720092904008901
>
> When I read in the data file, this string shows up as 3.200801e+36.  To get
> rid of the scientific notation, I used "options(scipen=999)."  When I did
> this, the scientific notation went away, but the numeric string was
> incorrect.  It showed as:
>
> 3200801200801172223262666846080882062
>
> Why would the number be incorrect?  All of the other strings within this
> row
> are correct.
>
> Thanks,
>
> Andrew
>
>
> --
> View this message in context:
> http://www.nabble.com/R-numeric-string-problem-tp24940459p24940459.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[alternative HTML version deleted]]

______________________________________________
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