Hi sorry if this is really basic but I am just starting on R. Can anyone point me at how to write R objects into Excel 2007 files. I have seen how to set up a connection to a file through odbcConnectExcel2007(xls.file, readOnly = FALSE, ...) but it doesn't say anything on how to write data Thanks _____________________________________________________________________ The information contained in or attached to this email is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege (or other rules or laws with similar effect in jurisdictions outside England and Wales). The views expressed in this email are not necessarily the views of Centrica plc, and the company, its directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary. Centrica plc Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD Registered in England and Wales No 3033654 [[alternative HTML version deleted]]
Agnolucci, Paolo wrote:> > Hi > > > > sorry if this is really basic but I am just starting on R. > > > > Can anyone point me at how to write R objects into Excel 2007 files. I > have seen how to set up a connection to a file through > odbcConnectExcel2007(xls.file, readOnly = FALSE, ...) but it doesn't say > anything on how to write data > > > > Thanks > > Registered in England and Wales No 3033654 > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > >I am not sure how to write into Excel 2007 format (*.xlsx) but there is a package that makes writing (and reading) excel files in the older format (*.xls) fairly easy. This package is called xlsReadWrite. To read an excel file in using this package: foo<-read.xls(file="filename.xls", colNames=TRUE, rowNames=TRUE, sheet="Sheet1", type="data.frame",checkNames=TRUE) To write an excel file using this package: write.xls( foo, "filename.xls", colNames = TRUE) It is fairly easy to use and Excel 2007 easily reads and write to this older format. -- View this message in context: http://www.nabble.com/odbcConnectExcel2007-tp20208757p20211085.html Sent from the R help mailing list archive at Nabble.com.
On Tue, 28 Oct 2008, Agnolucci, Paolo wrote:> Hi > > > > sorry if this is really basic but I am just starting on R. > > > > Can anyone point me at how to write R objects into Excel 2007 files. I > have seen how to set up a connection to a file through > odbcConnectExcel2007(xls.file, readOnly = FALSE, ...) but it doesn't say > anything on how to write dataSee sqlWrite in the RODBC (the uncredited package here) documentation. See also the examples in the installed tests.R file. -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595