[R] Import xlsx file in Ubuntu 9.04

Duncan Temple Lang duncan at wald.ucdavis.edu
Wed Jul 8 18:15:47 CEST 2009


I did some preliminary work on xslx (and docx and pptx) files
some time ago and will hopefully finish things off by the
end of summer.  We can read these with a combination
of the Rcompression and XML package.

I have put versions of two packages (ROOXML and RExcelXML)
at

   http://www.omegahat.org/Prerelease/

(ROOXML_0.1-0.tar.gz and RExcelXML_0.1-0.tar.gz)

There are no guarantees about how they work at this point, but
the basic structures are there. I'd be happy to hear about any problems
and to try to add functionality. Given the framework, it should
be relatively easy to add support for additional cell types, etc.


   D.



Marc Schwartz wrote:
> On Jul 8, 2009, at 6:56 AM, Rodrigo Aluizio wrote:
> 
>> Hi list,
>> By the entire last 2 weeks I was looking for a way to directly import 
>> xlsx
>> files to R in a Linux OS (Ubuntu 9.04). I already read the R 
>> Import/Export
>> guide, and I know how to use gdata to import xls files and read.table to
>> import .csv. My problem is that all data that I receive is in the xlsx
>> format, and I have to convert all the files to xls.
>> Well, when I was using Windows Vista OS, RODBC did the trick with the
>> odbcConnectExcel2007 function (which I know is not present in the Linux
>> RODBC package, probably due to drivers issue). Isn't there a way to 
>> import
>> this xlsx files directly to R without any previous conversion (.csv or
>> .xls)?
>>
>> Thank you for the attention, it's probable that some one already asked 
>> it. I
>> even remember seen that somewhere, but without a definitive answer.
>>
>> Rodrigo.
> 
> 
> 
> Your best bet on Linux would be to open the Excel 2007 files using 
> OpenOffice's Calc and save them to CSV files. The latest versions of 
> OpenOffice will open Office 2007 files.
> 
> An alternative of course would be to see if it is reasonable for the 
> providers of the files to save them in the older XLS format instead, or 
> to see if they have other file formats that they can send you rather 
> than using Excel at all.
> 
> There is a very preliminary Perl module in progress, that should 
> eventually provide for a more efficient path:
> 
>   http://search.cpan.org/dist/Spreadsheet-XLSX/
> 
> But from what I have seen, there are enough problems with it (including 
> data integrity issues), that I would not use it in production work.
> 
> Unfortunately, I don't believe that you have a lot of options on Linux 
> at the moment.
> 
> HTH,
> 
> Marc Schwartz
> 
> ______________________________________________
> 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.




More information about the R-help mailing list