Skip to content

Small Functions for Writing HTML Files

3 messages · Zed Shaw, Christophe Declercq

#
Hello All,

I wrote this small set of functions for writing HTML files on the fly so I 
could do reports from R.  Nothing fancy.  I may expand on this and make it 
more generic, but for now, it works and I'm happy with it.

Thought I would share them with everyone to get some  feedback.  Also, I'm 
not sure if there is already something like this available.

The html-test.r file shows you how to use the html.r functions.  Combined 
with the xtable library, this is pretty handy.

Thanks for your time.
#
Hi, Zed
Have you tried 'Sweave()' which was announced by Friedrich Leisch on
this list ('Re: [R] Code in Rd help files other than in \examples{}' Tue
Feb 12 2002 - 07:33:21 EST)?

You can find it in the preview of the 'tools' package at
http://www.ci.tuwien.ac.at/~leisch/Sweave

It is really great and easy to use (thank you very much, Friedrich!).

It only works with 'LaTeX' for now but perhaps you could contribute an
'html' driver?

Christophe
--
Christophe DECLERCQ, MD
Observatoire R?gional de la Sant? Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail c.declercq at orsnpdc.org


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Hmmm, very interesting.  I'll look into this.  Using what I have here 
as a base, it might not be too hard.  Still, I have to see how it's 
being done.  One thing that I see as a problem is the use of <<>>= to 
mark off code pieces.  Not sure how that would mess with html tag since 
they use <> combos.

I personally don't much like literate programming tools since they make 
it hard to figure out what is code and what is docs.  They drive 
programmers like me insane (I like everything neatly in its own 
place).  But, it might be interesting to see how an HTML literate tool 
would work.

My original plan for this HTML stuff is to make it so you just hand a 
bunch of different objects to a "report" function and it spits out a 
basic kind of report in forever rolling HTML.  But, I still haven't 
figured out how to do it.  For now, I just wrote a function called 
myreport which I pass it my data and it writes my report for me.

Anyway, thanks for your comments.  I'll let you knwo what I find out.
On 2002.03.04 01:02 Christophe Declercq wrote:
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._