I'm not Uwe, but here are some of the things to try if you want to do this fully in R.
Look at the help for scan, one approach to reading in a .rnw file is to use scan, but set it to read each row of the file as a character matrix. The 'see also' section of the scan help page has some other functions that could be used to read in the file as well. Modify the read in character strings with the sub or gsub functions. Use cat (with a file argument) to write the character strings back to a file. Also look at the commandArgs function for one way to pass options (the device name(s)) to your R script. You may also want to read (or reread) the "Invoking R" section of "An Introduction to R". Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ptit_Bleu > Sent: Tuesday, December 11, 2007 8:05 AM > To: r-help@r-project.org > Subject: Re: [R] Sweave : change value in rnw file to > generate multiple "single" reports ? > > > Dear Uwe, > > Could you please give me the name of the function to open, to > modify and to save a r script ? > Just the name and I will look for the way to use them. > > And if you have a link explaining how to use user customized > variables from an environment variable, it will be very > helpful (as it is completely new to me). > > Thanks in advance, > Ptit Bleu. > > ------------------------------------------------ > > > Within or before SWeave, you can use R. > Hence you can write some R function that first changes the > rnw and runs SWeave thereafter, or even better, write > something in your SWeave code that reads a user customized > variables, e.g. from an environment variable or from some text file. > > Uwe Ligges > -- > View this message in context: > http://www.nabble.com/Sweave-%3A-change-value-in-rnw-file-to-g > enerate-multiple-%22single%22-reports---tp14256204p14275809.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.