[R] Sweave in makefile under Win XP

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 29 09:48:07 CEST 2004


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




More information about the R-help mailing list