[R] Paste in a FOR loop

Dieter Menne dieter.menne at menne-biomed.de
Wed Dec 31 12:28:12 CET 2008


Michael Pearmain <mpearmain <at> google.com> writes:

> 
> Hi All,
> I've been having a little trouble using R2HTML and a loop, but can't figure
> out where the problem lies, any hints gratefully received.
> 

..
> library(R2HTML)
> HTMLStart(outdir =
> file.path("C://Example_work","R_projects","Dynamic_creative"),filename =
> "RMDC_mockup",Title="Mock up for RMDC")
> 
> for(group in 1:3){
> paste("summary(z.out.", group, sep = "")
> paste("summary(s.out.", group, sep = "")
> paste("s.out.",group,"$qi$ev", sep = "")
> HTMLplot()
> }
> HTMLStop()


Check documentation on HTMLInsertGraph, and don't forget to change the filename
in the loop, otherwise you always see the last file.

Dieter



More information about the R-help mailing list