Hi all. To automate the production of a document I want to have something like: test.tex : test.Rnw "Sweave("test.Rnw") "| R --no-restore --no-save in a makefile. This however gives an error as R states: Sweave("test.Rnw") : not found. I use R-1.9.0pat (040424 I think) on Win XP. Any suggestions, hints or plain help appreciated. Steen Ladelund [[alternative HTML version deleted]]
"Ladelund, Steen" <STEL at glostruphosp.kbhamt.dk> writes:> Hi all. > > To automate the production of a document I want to have something like: > > test.tex : test.Rnw > "Sweave("test.Rnw") "| R --no-restore --no-save > > in a makefile. > > This however gives an error as R states: Sweave("test.Rnw") : not found.If that's what you did, I don't think R ever saw it. The shell would think that you were trying run a program called "Sweave(test.Rnw) ". If you want to pipe the string to R, you need at least an "echo" in front of it. Also beware that the quotes as written don't match up the way I think you think they do. echo "Sweave(\"test.Rnw\")"| R --no-restore --no-save should be more like it. Notice that you need to start the line with a TAB inside a makefile, not 4 spaces (or did your email program just mangle it?). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Thu, 29 Apr 2004, Ladelund, Steen wrote:> Hi all. > > To automate the production of a document I want to have something like: > > test.tex : test.Rnw > "Sweave("test.Rnw") "| R --no-restore --no-save > > in a makefile. > > This however gives an error as R states: Sweave("test.Rnw") : not found. > > I use R-1.9.0pat (040424 I think) on Win XP. > > Any suggestions, hints or plain help appreciated.Look at the examples in the makefiles in the R sources, and beware of shell quoting. So echo "Sweave('test.Rnw')" | Rterm.exe --vanilla --slave may be the simplest. (I would avoid using `R' in programming as it may well find the wrong thing one day.) -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Reasonably Related Threads
- Factor function: odd behavior when labels argument contains duplicates?
- P-values from survreg (survival package) using a clusterterm
- Left justification af dimnames in tables.
- Danish characters i R2.0.1 vs R1.9.1 under winXP
- Sweave: R code in self defined TeX-commands