Hi, I am trying to output an dataframe from R to Excel file. Can anyone tell me how to do it? Thanks a lot. Eg. R dataframe: A B C 1 2 1 3 4 2 . . . [[alternative HTML version deleted]]
> I am trying to output an dataframe from R to Excel file. Can anyone > tell me how to do it? Thanks a lot.write.csv() might get you where you want to go.
On Sun, 13 Mar 2005, Faith G wrote:> Hi, > I am trying to output an dataframe from R to Excel file. Can anyone tell me how to do it? Thanks a lot. > Eg. > R dataframe: > A B C > 1 2 1 > 3 4 2 > . . .?write.table (see also the nice example)> > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no
--- Faith G <gaof at u.washington.edu> wrote:> Hi, > I am trying to output an dataframe from R to Excel file. Can anyone > tell me how to do it? Thanks a lot. > Eg. > R dataframe: > A B C > 1 2 1 > 3 4 2 > . . . >Try: write.table(mydf, "c:/mydf.csv", sep=",", row.names=FALSE) Then open 'mydf.csv' in Excel. Tomas http://www.epitools.net
E.g. write.excel <- function(tab, ...) write.table( tab, "clipboard", sep="\t", row.names=F) write.excel(your.data.frame) and pressing Ctrl-V in Excel copies your.data.frame to Excel Cheers Petr On 13 Mar 2005 at 14:26, Faith G wrote:> Hi, > I am trying to output an dataframe from R to Excel file. Can anyone > tell me how to do it? Thanks a lot. Eg. R dataframe: A B C 1 > 2 1 3 4 2 . . . > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.htmlPetr Pikal petr.pikal at precheza.cz