Re: [R] how to scientific notation numbers

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Fri, 21 Mar 2008 23:03:29 -0400

I can't reproduce that on my system. When I try it it works. (In reality you would replace textConnection(Lines) with the name of your file.)

> Lines <- "

+  6.5500000000000000e+004  2.8235000000000001e+000  3.2000000000000000e+001
+ 1.1580000000000000e+003  2.4400000000000000e+002  5.9800000000000000e+002
+ 2.2700000000000000e+002  3.9030000000000001e+001 -1.2137000000000000e+002"

> read.table(textConnection(Lines))
V1 V2 V3 1 65500 2.8235 32.00

2 1158 244.0000 598.00
3 227 39.0300 -121.37

> R.version.string # Vista
[1] "R version 2.6.2 alpha (2008-01-26 r44181)"

On Fri, Mar 21, 2008 at 10:53 PM, HelponR <suncertain_at_gmail.com> wrote:
> Hi, Sorry I have to bother you a question.
>
> I have a file with each line like this:
>
> 6.5500000000000000e+004 2.8235000000000001e+000 3.2000000000000000e+001
> 1.1580000000000000e+003 2.4400000000000000e+002 5.9800000000000000e+002
> 2.2700000000000000e+002 3.9030000000000001e+001 -1.2137000000000000e+002
>
>
> However, I use read.table, it cannot read it correctly. It read in 18
> variables instead of 9.
>
> I am so frustrated. I tried to search the archive. Seems nobody else has
> this problem.
>
> Thank you!
>
> U
>
> [[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.
>



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. Received on Sat 22 Mar 2008 - 03:06:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 22 Mar 2008 - 10:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive