[R] reformatting R scripts for htmlize()

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


Hi!

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
plot(mishdift(sel$hora))

into:

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

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.

Thanks!

Agus

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



More information about the R-help mailing list