[R] Can not read Excel file correctly

Ron Michael ron_michael70 at yahoo.com
Tue Oct 29 22:55:21 CET 2013


I need to read an Excel file which can be available in following link:

Now I wanted to read the 1st sheet of this Excel file. Below are my code so far (I saved that file in 'F:' drive):

> library(XLConnect)
Loading required package: rJava
XLConnect 0.2-5 by Mirai Solutions GmbH
http://www.mirai-solutions.com ,
> readWorksheetFromFile("f:/Dat1.xlsx", sheet = 1)
        Col1             Col2       Col3   Col4
1       <NA>               NA 2013-05-01   <NA>
2       <NA>               NA       <NA>   <NA>
3 1930-01-01               NA       <NA>   <NA>
4       <NA> 3127312736128730       <NA>   <NA>
5       <NA>               NA       <NA>   <NA>
6       <NA>               NA       <NA> SAsSag

What I saw that, the element in A1 cell is missing. Also the data in C1 & A4 are read in different format. In Excel file, it is Month-Year format, however what I see is Year-Month-Day format.

I have many such files, therefore I do not want to convert them to csv (or any other). Doing so will be cumbersome.

Can somebody here help me how to read that file in proper format?

Thanks for your time.

More information about the R-help mailing list