Re: [R] Is it possible to create highly customized report in *.xls format by using R/S+?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu 21 Jul 2005 - 09:27:38 EST

Here is an example where R is the client and Excel is the server so that R is issuing commands to Excel. This example uses the RDCOMClient package from www.omegahat.org:

	library(RDCOMClient)
	xl <- COMCreate("Excel.Application")  # starts up Excel
	xl[["Visible"]] <- TRUE                       # Excel becomes visible
	wkbk <- xl$Workbooks()$Add()          # new workbook

	# set some cells

	sh <- xl$ActiveSheet()

	x12 <- sh$Cells(1,2)
	x12[["Value"]] <- 123

	x22 <- sh$Cells(2,2)
	x22[["Value"]] <- 100

	x31 <- sh$Cells(3,1)
	x31[["Value"]] <- "Total"

	B3R <- sh$Range("B3")
	B3R[["Formula"]] <- "=Sum(R1C2:R2C2)"
	B3R[["NumberFormat"]] <- "_($* #,##0.00_)"
	B3RF <- B3R$Font()
	B3RF[["Bold"]] <- TRUE


	# save and exit
	wkbk$SaveAs("\\test.xls")
	xl$Quit()

Code using the rcom package at (second link is mailing list):

	http://sunsite.univie.ac.at/rcom/download/
	http://mailman.csd.univie.ac.at/pipermail/rcom-l/

would be nearly identical once the upcoming version of rcom comes out. rcom and omegahat both provide the possibility of having Excel as the client and R as the server; however, in that setup the user would have to have R running whereas in the above setup only you do.

On 7/20/05, Wensui Liu <liuwensui@gmail.com> wrote:
> I appreciate your reply and understand your point completely. But at
> times we can't change the rule, the only choice is to follow the rule.
> Most deliverables in my work are in excel format.
>
> On 7/20/05, Greg Snow <greg.snow@ihc.com> wrote:
> > See:
> >
> > http://www.burns-stat.com/pages/Tutor/spreadsheet_addiction.html
> > and
> > http://www.stat.uiowa.edu/~jcryer/JSMTalk2001.pdf
> >
> > Greg Snow, Ph.D.
> > Statistical Data Center, LDS Hospital
> > Intermountain Health Care
> > greg.snow@ihc.com
> > (801) 408-8111
> >
> > >>> Wensui Liu <liuwensui@gmail.com> 07/19/05 03:22PM >>>
> > I remember in one slide of Prof. Ripley's presentation overhead, he
> > said the most popular data analysis software is excel.
> >
> > So is there any resource or tutorial on this topic?
> >
> > Thank you so much!



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 Thu Jul 21 09:36:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:53 EST