Re: [R] writing a data frame in excel format

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 26 Apr 2005 - 17:50:49 EST

Hi Arne

On 26 Apr 2005 at 9:29, Arne Henningsen wrote:

> I save my data(frames) in csv format, which can be opened by any
> spreadsheet application:
>
> R> write.table( myData, "myFile.csv", col.names = NA, sep = "," )

Or you can write it as

write.table(r.data.frame, "excel.file.xls", sep="\t", na="", row.names=F)

which I can usually open in Excel just by clicking on it.

Cheers
Petr

>
> Arne
>
> On Tuesday 26 April 2005 04:28, Mario Morales wrote:
> > Hello
> >
> > I know how read a file in excel format into a R data frame using the
> > RODBC library, but I don't know how write a R data frame in excel
> > format. I don't understand the instructions from RODBC user manual.
> >
> > To read an excel file I use.
> >
> > library(RODBC);
> >
> > conex<-odbcConnectExcel("fis_quim.xls");
> >
> > sqlTables(conex);
> >
> > data<-sqlFetch(conex,"hoja1");
> >
> > Suppose I modify data and I want to save it as an excel file, How do
> > I do that?
> >
> > Thanks for your help
> >
> > Mario Alfonso Morales Rivera
> > Profesor Auxiliar.
> > Departamento de Matemáticas y Estadistica.
> > Universidad de Córdoba.
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
>
> --
> Arne Henningsen
> Department of Agricultural Economics
> University of Kiel
> Olshausenstr. 40
> D-24098 Kiel (Germany)
> Tel: +49-431-880 4445
> Fax: +49-431-880 1397
> ahenningsen@agric-econ.uni-kiel.de
> http://www.uni-kiel.de/agrarpol/ahenningsen/
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal@precheza.cz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Apr 26 17:55:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:26 EST