r-help, Is there a package available for R which allows you to export data directly to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? If not, is anyone working on this, or thinking about working on this? I apologise in advance if this question has already been answered. Many thanks, Matthew -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 31 Jul 2002, Dowle, Matthew [EQRE] wrote:> > r-help, > > Is there a package available for R which allows you to export data directly > to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? If not, is > anyone working on this, or thinking about working on this?The simplest solution is to use write.table() to produce a comma-separated text file, which Excel will read. The help page for write.table gives an example -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thanks for the reply. I do however need to create an .xls binary from R. The system I'd like R to talk to only accepts .xls format files and this needs to be automatic. I already have this working in S-PLUS and I was thinking of porting to R. I saw the Excel-R-Interface mentioned in the archives so maybe I could call Excel to load up the .csv and save as an .xls, but I'd prefer to keep things simple if possible and write the .xls format directly from R. Its got to be possible since Insightful managed to do it, now whether its difficult?? Regards, Matthew -----Original Message----- From: Thomas Lumley [mailto:tlumley at u.washington.edu] Sent: 01 August 2002 00:21 To: Dowle, Matthew [EQRE] Cc: 'r-help at lists.R-project.org' Subject: Re: [R] exportData(foo,"foo.xls","EXCEL") for R ? On Wed, 31 Jul 2002, Dowle, Matthew [EQRE] wrote:> > r-help, > > Is there a package available for R which allows you to export datadirectly> to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? If not,is> anyone working on this, or thinking about working on this?The simplest solution is to use write.table() to produce a comma-separated text file, which Excel will read. The help page for write.table gives an example -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The Perl Archive CPAN has a module called 'Spreadsheet::WriteExcel' that claims to "write formatted text and numbers to a cross-platform Excel binary file". It should be a simple matter to write a perl script that reads csv and writes XLS using this. -Greg> -----Original Message----- > From: rossini at blindglobe.net [mailto:rossini at blindglobe.net] > Sent: Wednesday, July 31, 2002 8:08 PM > To: Dowle, Matthew [EQRE] > Cc: 'r-help at lists.R-project.org' > Subject: Re: [R] exportData(foo,"foo.xls","EXCEL") for R ? > > > >>>>> "matthew" == Matthew Dowle <Dowle> writes: > > matthew> Thanks for the reply. I do however need to > create an .xls binary from R. The > matthew> system I'd like R to talk to only accepts .xls > format files and this needs > matthew> to be automatic. I already have this working in > S-PLUS and I was thinking of > matthew> porting to R. I saw the Excel-R-Interface > mentioned in the archives so maybe > matthew> I could call Excel to load up the .csv and save > as an .xls, but I'd prefer > matthew> to keep things simple if possible and write the > .xls format directly from R. > matthew> Its got to be possible since Insightful managed > to do it, now whether its > matthew> difficult?? > > Past discussions pointed to PERL libraries for doing this. If I'm not > mistaken, they are probably in the archive somewhere, from about 1-2 > years ago. I don't think there currently is a native R solution, > unless you are working with the R plug-in for Gnumeric (but even that > isn't quite "right"). > > It's a simple programming problem. The tricky part is finding someone > who has time (which can substitute for skill in this case, if enough > time can be found). > > best, > -tony > > -- > A.J. Rossini Rsrch. Asst. Prof. of > Biostatistics > U. of Washington Biostatistics > rossini at u.washington.edu > FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org > -------------- http://software.biostat.washington.edu/ > ---------------- > FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty > sketchy/use Email > UW: Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX > (my tuesday/wednesday/friday locations are completely unpredictable.) > > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. > -.-.-.-.-.-.-.-.- > r-help mailing list -- Read > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: > r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. > _._._._._._._._._ >LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Drs Lumley and Dalgaard have already outlined R ways of interchanging data with Excel. Other alternatives are to see if the other program can accept a text or CSV file instead write an R routine for exporting XLS files. Perhaps the format is documented by Microsoft? If S-PLUS has the required features it makes sense to continue using it. It's not really possible for open-source software and developers to match the resources of commercial companies. There are often license fees associated with reading and writing proprietary data formats, and the source code for doing so is generally not available. In my experience, R is very flexible in enabling data to be shared between a wide variety of programs on a number of platforms. Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia andreww at cheque.uq.edu.au On Thursday, August 01, 2002 9:40 AM, Dowle, Matthew [EQRE] [SMTP:matthew.dowle at citigroup.com] wrote:> > Thanks for the reply. I do however need to create an .xls binary from R.The> system I'd like R to talk to only accepts .xls format files and thisneeds> to be automatic. I already have this working in S-PLUS and I was thinkingof> porting to R. I saw the Excel-R-Interface mentioned in the archives somaybe> I could call Excel to load up the .csv and save as an .xls, but I'dprefer> to keep things simple if possible and write the .xls format directly fromR.> Its got to be possible since Insightful managed to do it, now whether its > difficult?? > > Regards, > Matthew > > -----Original Message----- > From: Thomas Lumley [mailto:tlumley at u.washington.edu] > Sent: 01 August 2002 00:21 > To: Dowle, Matthew [EQRE] > Cc: 'r-help at lists.R-project.org' > Subject: Re: [R] exportData(foo,"foo.xls","EXCEL") for R ? > > > On Wed, 31 Jul 2002, Dowle, Matthew [EQRE] wrote: > > > > > r-help, > > > > Is there a package available for R which allows you to export data > directly > > to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? Ifnot,> is > > anyone working on this, or thinking about working on this? > > The simplest solution is to use write.table() to produce acomma-separated> text file, which Excel will read. > > The help page for write.table gives an example > > -thomas >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Matthew Dowle <matthew.dowle at citigroup.com> wrote:> I do however need to create an .xls binary from R. The system I'd like R to > talk to only accepts .xls format files and this needs to be automatic.Another possibility may be to create an ascii file in the SYLK format, see: <http://www.jkrieger.de/programming/delphi/sylk.txt> <http://www.worldgate.ca/~rschulz/misc/sylksum.doc> If your SYLK file has extension ".xls", it is automatically read by Excel without any manual interaction, and acts a lot like a true .xls binary. Try it with the following very simple example: (--- snip here and save as "db.xls" ---) ID;PBrahm's SYLK example F;K;G F;W1 1 8 F;W2 2 8 P;FArial;M200;L9 P;FArial;M200;SB;L9 P;FArial;M200;SI;L9 P;FArial;M200;SBI;L9 P;FArial;M200;SB;L13 F;X1;Y1;FF0C;SM5TBL C;K"a" F;X2;Y1;FF0C;SM5TBR C;K"b" F;X1;Y2;FF3G;SBL C;K1.000 F;X2;Y2;FF3G;SBR C;K2.000 E (--- end snip ---) -- -- David Brahm (brahm at alum.mit.edu) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dowle, Matthew [EQRE]
2002-Aug-01 17:05 UTC
[R] RE: exportData(foo,"foo.xls","EXCEL") for R ?
Dear all, A huge thank you to all the people who responded. I now have quite a list of possible solutions to work through! Hopefully I'll report some success back to you soon ... Best regards, Matthew> -----Original Message----- > From: Dowle, Matthew [EQRE] > Sent: 31 July 2002 23:13 > To: r-help at lists.R-project.org > Subject: exportData(foo,"foo.xls","EXCEL") for R ? > > > r-help, > > Is there a package available for R which allows you to export data > directly to .xls, much like exportData(foo,"foo.xls","EXCEL") in S-PLUS ? > If not, is anyone working on this, or thinking about working on this? > > I apologise in advance if this question has already been answered. > > Many thanks, > Matthew > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Professor Ripley was right. I was in fact joking about using specifications documented by Microsoft to write a native R function to save files in XLS format. Any Windows-based programs that can "directly" read or write XLS files does so using hooks into the operating system (the Excel Objects library) rather than doing anything itself. I think that the perfect volunteers to conduct or manage extensions to the data exchange capabilities of R are those who request them :-) Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia andreww at cheque.uq.edu.au On Thursday, August 01, 2002 4:53 PM, ripley at stats.ox.ac.uk [SMTP:ripley at stats.ox.ac.uk] wrote:> On Thu, 1 Aug 2002, Andrew C. Ward wrote: > > > Drs Lumley and Dalgaard have already outlined R ways of interchangingdata> > with Excel. Other alternatives are to > > see if the other program can accept a text or CSV file instead > > write an R routine for exporting XLS files. Perhaps the format is > > documented by Microsoft? > > You must be joking! That has been one of the major hurdles in people's > attempts to do this. One also has to be careful which version(s) of .xls > programs can read or write, as the current format (which uses OLE > containers) is very different to earlier ones. > > > If S-PLUS has the required features it makes sense to continue usingit.> > It's not really possible for open-source software and developers tomatch> > the resources of commercial companies. There are often license fees > > associated with reading and writing proprietary data formats, and the > > source code for doing so is generally not available. In my experience,R is> > very flexible in enabling data to be shared between a wide variety of > > programs on a number of platforms. > > Not really so in this case. > > 1) As far as I am aware S-PLUS can only handle current .xls on Windows > (and not say Linux). As I understand it, the ability to read/write that > format is in the OS's dlls. > > 2) There are Open Source solutions that R could build on (and acommercial> package could not). Perl modules have been mentioned (now and before), > and Gnumeric and Open Office and others must be suitables resources. I > did suggest when this last came up that someone used the Gnumericsources.> > The real issue though is priorities. We are very short of people willing > to work on Windows, down now to the level of maintaining the port that we > have. > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272860 (secr) > Oxford OX1 3TG, UK Fax: +44 1865 272595 > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.-.-> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._