[R] reformatting R scripts for htmlize()

Agustin Lobo aloboaleu at gmail.com
Wed Jun 18 11:49:08 CEST 2008


I have a bunch of (mainly class) R scripts that I would
like to convert into html pages (although if someone
thinks that what I want to do is easier with latex or pdf,
please tell me).

Considering the format of my files, htmlize() seems the best
option. The only problem is that I would need
to write graphics to a file, thus
converting parts like:

plot(sel$hora, sel$COD_SP_C)
#and check the time intervals


png("1.png");plot(sel$hora, sel$COD_SP_C);dev.off()
#and check the time intervals

Any ideas on how to write an script (could be done
in R itself?) that would automatically modify
the current script into a "htmlize-friendly" script?

One problem is that while R accepts png()
providing a default name for the png file,
htmlize() fails unless a name is provided.



Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es

More information about the R-help mailing list