Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

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

Whit Armstrong

2005-07-20

Replies:

I have a package which I use to create excel files from R.

I have not been able to produce a configure script general enough for me
to post it to cran, but I will send it to you if you like.

I use it for production jobs on our linux servers. You may have to
tinker a bit to get it to compile on windows.

Have a look at the examples below. If it suits your needs, I will send
it to you.

Cheers,
Whit


Here are the examples from the help page:

  nc <- 4
  nr <- 20
  x <- matrix(rnorm(nc*nr),ncol=nc,nrow=nr)

  rownames(x) <- rep(letters,length=nr)
  colnames(x) <- rep(letters,length=nc)

  # write a matrix
  write.xls(x,"matrixFromR.xls","matrix")
  write.xls(x,"matrixFromR.no.colnms.xls","matrix",writeColNms=FALSE)
  write.xls(x,"matrix.no.rownms.xls","matrix",writeRowNms=FALSE)

write.xls(x,"matrix.no.nms.xls","matrix",writeColNms=FALSE,writeRowNms=F
ALSE)

  # add some formats

write.xls(x,"matrixFromR_formatted.xls","matrix",formats=rep("0.0",nc))

write.xls(x,"matrixFromR_formatted2.xls","matrix",formats=rep(c("0.0","0
"),nc/2))

write.xls(x,"matrixFromR_formatted3.xls","matrix",formats=rep("#,##0.0;[
Red]#-##0.0;\"\"",nc))

  write.xls(x[,1],"vectorFromR.xls","vector")

write.xls(x[,1],"vectorFromR.no.colnms.xls","vector",writeColNms=FALSE)

write.xls(x[,1],"vectorFromR.no.rownms.xls","vector",writeRowNms=FALSE)

write.xls(x[,1],"vectorFromR.no.nms.xls","vector",writeColNms=FALSE,writ
eRowNms=FALSE)

  # char data test
  y <- matrix(rep(letters,each=26),ncol=26)
  rownames(y) <- rep(letters,length=26)
  colnames(y) <- rep(letters,length=26)
  write.xls(y,"char.data.xls","alphabet")

  # logical data test
  z <- matrix(as.logical(round(runif(nc*nr),0)),ncol=nc)
  rownames(z) <- rep(letters,length=nr)
  colnames(z) <- rep(letters,length=nc)

  write.xls(z,"logical.data.xls","myLogic")
  write.xls(z[,1],"logical.data.vector.xls","myLogicVector")



-----Original Message-----
From: r-help-bounces@(protected)
[mailto:r-help-bounces@(protected)
Sent: Wednesday, July 20, 2005 10:56 AM
To: Greg Snow
Cc: r-help@(protected)
Subject: Re: [R] Is it possible to create highly customized report in
*.xlsformat by using R/S+?

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@(protected):
> 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@(protected)
> (801) 408-8111
>
> >>> Wensui Liu <liuwensui@(protected) >>>
> 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@(protected)
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>


--
WenSui Liu, MS MA
Senior Decision Support Analyst
Division of Health Policy and Clinical Effectiveness Cincinnati Children
Hospital Medical Center

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.