Dear all, i use the following package/syntax to export data to excel: library(xlsReadWrite) write.xls( exportdata,pfad,colNames = TRUE,sheet = 1,from = 1,rowNames FALSE ) Everything is fine, but the format of the export is not the best. For example, I every time have to adjust the column width. Furthermore there is no possibility to highlight some cell or make them colourful. I create a lot of such outputs and I want to have the sheets in a nicer format to make them better readable, especially for the people, who works with my files. Have you any suggestions to reach this target? Ideally I can do this within R and not in a second step via a VBA-Makro or something like this. Is there a possibility in R, e. g. with a package? I have the same problem with the package xtable for export to Latex. I am very happy about the packages, but it would be perfect, if I can adjust some things in this direction. Probably there are somes ways for a solution. I am very glad about references. Thank you very much in advance, Jens. -- View this message in context: http://old.nabble.com/Excel-Export-tp26477654p26477654.html Sent from the R help mailing list archive at Nabble.com.
Use the RDCOMClient package from omegahat.org. On Mon, Nov 23, 2009 at 11:02 AM, koj <jens.koch at gmx.li> wrote:> > Dear all, > > i use the following package/syntax to export data to excel: > > library(xlsReadWrite) > write.xls( exportdata,pfad,colNames = TRUE,sheet = 1,from = 1,rowNames > FALSE ) > > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore there is > no possibility to highlight some cell or make them colourful. > > I create a lot of such outputs and I want to have the sheets in a nicer > format to make them better readable, especially for the people, who works > with my files. > > Have you any suggestions to reach this target? Ideally I can do this within > R and not in a second step via a VBA-Makro or something like this. Is there > a possibility in R, e. g. with a package? > > I have the same problem with the package xtable for export to Latex. > > I am very happy about the packages, but it would be perfect, if I can adjust > some things in this direction. Probably there are somes ways for a solution. > I am very glad about references. > > Thank you very much in advance, > > Jens. > > > > > -- > View this message in context: http://old.nabble.com/Excel-Export-tp26477654p26477654.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
On Nov 23, 2009, at 7:02 AM, koj wrote:> > Dear all, > > i use the following package/syntax to export data to excel: > > library(xlsReadWrite) > write.xls( exportdata,pfad,colNames = TRUE,sheet = 1,from = > 1,rowNames > FALSE ) > > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore > there is > no possibility to highlight some cell or make them colourful. > > I create a lot of such outputs and I want to have the sheets in a > nicer > format to make them better readable, especially for the people, who > works > with my files. > > Have you any suggestions to reach this target? Ideally I can do this > within > R and not in a second step via a VBA-Makro or something like this. > Is there > a possibility in R, e. g. with a package? > > I have the same problem with the package xtable for export to Latex. > > I am very happy about the packages, but it would be perfect, if I > can adjust > some things in this direction. Probably there are somes ways for a > solution. > I am very glad about references. > > Thank you very much in advance, > > Jens.The ability to adjust columns widths in a predictable fashion is not easy to implement outside of Excel (or an equivalent application). The Auto-fit function in Excel, for example, is a run-time only feature, which means that Excel must be available and running. The problem is that assumptions have to be made as to the cell content on a per column basis, including the font and font formatting being used and is not guaranteed to be accurate outside of Excel. I had looked at this for the WriteXLS package, but it is problematic. With respect to the formatting of individual cells (colors, borders, etc.), you might want to look at the RDCOMClient package: http://www.omegahat.org/RDCOMClient/ See examples in the Introduction for that package. HTH, Marc Schwartz
Jens, 2009/11/23 koj <jens.koch at gmx.li>:> library(xlsReadWrite) > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore there is > no possibility to highlight some cell or make them colourful.Auto-col is supported by the underlying library and should be doable easily. Formatting probably only in the pro version, but in any case I intend to work on crossplatform support first (for both versions). Feel free to submit a feature request here: https://redmine.swissr.org/projects/xlsreadwrite username: traveleR, password: namaste (sha1 fingerprint: A4:28:1D:3A:C3:96:01:4B:8F:4C:FC:AD:E7:B5:B7:84:B1:6B:7A:E7) Cheers, Hans-Peter
If had done a little searching before posting, you surely would have found this link https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html which describes how to create .xls files that are customized any way that you desire. Kevin Wright On Mon, Nov 23, 2009 at 7:02 AM, koj <jens.koch@gmx.li> wrote:> > Dear all, > > i use the following package/syntax to export data to excel: > > library(xlsReadWrite) > write.xls( exportdata,pfad,colNames = TRUE,sheet = 1,from = 1,rowNames > FALSE ) > > Everything is fine, but the format of the export is not the best. For > example, I every time have to adjust the column width. Furthermore there is > no possibility to highlight some cell or make them colourful. > > I create a lot of such outputs and I want to have the sheets in a nicer > format to make them better readable, especially for the people, who works > with my files. > > Have you any suggestions to reach this target? Ideally I can do this within > R and not in a second step via a VBA-Makro or something like this. Is there > a possibility in R, e. g. with a package? > > I have the same problem with the package xtable for export to Latex. > > I am very happy about the packages, but it would be perfect, if I can > adjust > some things in this direction. Probably there are somes ways for a > solution. > I am very glad about references. > > Thank you very much in advance, > > Jens. > > > > > -- > View this message in context: > http://old.nabble.com/Excel-Export-tp26477654p26477654.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Kevin Wright [[alternative HTML version deleted]]
2009/11/24 Kevin Wright <kw.stat at gmail.com>:> If had done a little searching before posting, you surely would have found > this link > https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html > which describes how to create .xls files that are customized any way that > you desire.Manually convert to html, then manually hack around with a texteditor..., not a good idea, imho. RDCOM is better. Hans-Peter
The rcom package allows you to access the Excel object model from within R. So you can do essentially you can either do manually or by VBA from within Excel also from R. Formatting cells should not be too hard. Hans-Peter Suter wrote:> 2009/11/24 Kevin Wright <kw.stat at gmail.com>: >> If had done a little searching before posting, you surely would have found >> this link >> https://stat.ethz.ch/pipermail/r-help/2008-July/169149.html >> which describes how to create .xls files that are customized any way that >> you desire. > > Manually convert to html, then manually hack around with a > texteditor..., not a good idea, imho. RDCOM is better. > > Hans-Peter > > ______________________________________________ > 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. > >-- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459