on 07/23/2008 08:29 PM XinMeng wrote:
Hi all: I wanna know how to expoort ".xls" file. And in the exported
".xls" file, how to set different cells with different color?

Thanks a lot! My best.

You don't indicate what operating system you are using and that is important as most of the relevant R packages/functions are Windows specific.

If you are on Windows, then you might want to look at the xlsReadWrite CRAN package to address the basic process of creating Excel files. More information is available via the R Wiki here:

http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows

The being said, a quick review suggests that the packages do not offer any cell level formatting functions.

If you are looking to create formatted reports, I would urge you to consider looking at using R's Sweave package, which uses LaTeX to enable reproducible research. An alternative would be the odfWeave package, which enables you to create OpenOffice.org documents that can also then be saved as MS Office documents or printed to PDF files. For some ideas of how Sweave can be used, go here:

http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/StatReport

If you must stay with Excel (eg. job requires it) and want to automate such operations, and further, might be comfortable coding in Perl, you can look at the Spreadsheet::WriteExcel module on CPAN:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm

This module would provide for platform independent creation and cell level formatting of Excel files.

HTH,

Marc Schwartz

______________________________________________
R-help@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.

Reply via email to