gdata read.xls() values format problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

gdata read.xls() values format problem

Victor11
Dear All,

When I use read.xls() in gdata package to read xls files, I noticed an issue and couldn't find any solutions after I serched all previous posts.

In the excel file, the number value, for example, is actually 2.3456789 but formatted as 2.3 (Format Cells ---> Decimal places:1). After I use read.xls() to import the excel file, I found that, in R, this number is read as the formatted value 2.3, instead of the actural value 2.3456789.

Since I usually read many excel files at the same time, it would be inconvenient if I change the format in each excel file. So I'm wondering if there is any argument in read.xls() or any other ways so it can read the actual value?

I would realy appcireate for your help.

Thanks.
Victor
Reply | Threaded
Open this post in threaded view
|

Re: gdata read.xls() values format problem

Gabor Grothendieck
On Thu, Jul 7, 2011 at 4:23 PM, Victor11 <[hidden email]> wrote:

> Dear All,
>
> When I use read.xls() in gdata package to read xls files, I noticed an issue
> and couldn't find any solutions after I serched all previous posts.
>
> In the excel file, the number value, for example, is actually 2.3456789 but
> formatted as 2.3 (Format Cells ---> Decimal places:1). After I use
> read.xls() to import the excel file, I found that, in R, this number is read
> as the formatted value 2.3, instead of the actural value 2.3456789.
>
> Since I usually read many excel files at the same time, it would be
> inconvenient if I change the format in each excel file. So I'm wondering if
> there is any argument in read.xls() or any other ways so it can read the
> actual value?
>
> I would realy appcireate for your help.
>

I don't think gdata can handle that.  Suggest you try one of the other
packages listed on this page:

http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows&s=excel


--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: gdata read.xls() values format problem

Victor11
Thank you for your suggestion Gabor. I hope they can fix this in later versions.

Victor
Reply | Threaded
Open this post in threaded view
|

Re: gdata read.xls() values format problem

Gabor Grothendieck
In reply to this post by Gabor Grothendieck
On Thu, Jul 7, 2011 at 6:07 PM, Gabor Grothendieck
<[hidden email]> wrote:

> On Thu, Jul 7, 2011 at 4:23 PM, Victor11 <[hidden email]> wrote:
>> Dear All,
>>
>> When I use read.xls() in gdata package to read xls files, I noticed an issue
>> and couldn't find any solutions after I serched all previous posts.
>>
>> In the excel file, the number value, for example, is actually 2.3456789 but
>> formatted as 2.3 (Format Cells ---> Decimal places:1). After I use
>> read.xls() to import the excel file, I found that, in R, this number is read
>> as the formatted value 2.3, instead of the actural value 2.3456789.
>>
>> Since I usually read many excel files at the same time, it would be
>> inconvenient if I change the format in each excel file. So I'm wondering if
>> there is any argument in read.xls() or any other ways so it can read the
>> actual value?
>>
>> I would realy appcireate for your help.
>>
>
> I don't think gdata can handle that.  Suggest you try one of the other
> packages listed on this page:
>
> http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows&s=excel

Just one correction to my post above.  gdata's read.xls does not
handle that for the older xls files but for xlsx files, i.e. used by
the current version of Excel, it does handle it.

--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
[hidden email] 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.