[R] writing to .xlsx

Marc Schwartz marc_schwartz at me.com
Wed Jan 9 23:03:42 CET 2013

On Jan 9, 2013, at 2:45 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:

> On Wed, Jan 9, 2013 at 2:19 PM, Benjamin Caldwell
> <btcaldwell at berkeley.edu> wrote:
>> Dear r helpers;
>> I'm interested in reading from and writing to large .xlsx files fairly
>> regularly.  (Why, the naysayers may ask - and the answer is basically
>> colleagues and clients who prefer that format). I've tried out the
>> XLConnect and xlsx libraries, but the java implementation they use just
>> takes too much RAM for the files I'm working with.
>> gdata leverages perl and works really well for reading in those files, so
>> half the problem is solved for me! I don't see anything in the
>> documentation about writing .xlsx, though. Is anyone aware of any libraries
>> or clever solutions in R that would get the job done for me? I see a couple
>> packages on CPAN for writing an xlsx, so it's been done in perl; perhaps it
>> would be easy to run that from R? I don't use perl myself (yet?).
>> Looking for recommendations.
>> Best
>> Ben Caldwell
> Check out
> http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows&s=excel
> and in particular the WriteXLS package can write Excel 2003 files
> (xls) using perl.

Thanks for the referral Gabor.

If Benjamin needs the xlsx format due to the larger dimensions supported, WriteXLS, since it writes xls format files, would not likely be suitable. Otherwise, of course, current versions of Excel can open the older format.

If Benjamin simply needs to dump larger (for some definition of larger) datasets externally in format that is compatible with Excel, he could write out CSV files that, of course, can then be opened in Excel. That presumes that he is not looking to do any other formatting of the worksheets or other similar functionality that is native to Excel.


Marc Schwartz

More information about the R-help mailing list