[R] Sweave : change value in rnw file to generate multiple "single"reports ?
Duncan Murdoch
murdoch at stats.uwo.ca
Mon Dec 10 19:32:43 CET 2007
On 12/10/2007 11:49 AM, ONKELINX, Thierry wrote:
> I think something like this would work.
>
> Change your query to
>
> rs <- dbSendQuery(con, statement = paste("select * from treatdata where
> name='", whichDevice,"'", sep = ""))
>
> And then create a script like.
>
> whichDevice <- "Device1"
> Sweave("myfile.rnw")
> whichDevice <- "Device2"
> Sweave("myfile.rnw")
Yes, I had forgotten that works. I usually use R CMD Sweave, where (as
Gabor mentioned) it's harder to set variables.
Duncan Murdoch
More information about the R-help
mailing list