[R] R2HTML Report number format, or Better Way?

Jim Lemon jim at bitwrit.com.au
Sun Jan 3 22:44:50 CET 2010


On 01/04/2010 03:36 AM, L.A. wrote:
> Here I am again with question I'll feel foolish for asking, when I
> see the answer.
>    I'm trying to produce a report and here's where I get stuck:
>   How do I get R2HTML to produce the same number format?
> Particularly remove the decimal places for Par and Sal.
>    Are there better methods to produce this type of report?
>    
Hi L.A.,
Try this:

# la1.dat is a text file with your sample data
srtype<-read.table("la1.dat",header=TRUE)
# I don't know where the rownames came from
# so I added them
rownames(srtype)<-
  c("RES I","RES V","OTHER","COM I","COM")
library(prettyR)
delim.table(srtype,"srtype.html",delim="<td>",
  tabegin="<table border=0>",bor="<tr><td>",
  tablend="</table>",header="<html><body>",
  trailer="</body></html>")

Now have a look at the file "srtype.html".

Jim



More information about the R-help mailing list