[Rd] Sweave.sh shell script on CRAN

Gabor Grothendieck ggrothendieck at gmail.com
Mon Apr 16 19:53:53 CEST 2007


On 4/16/07, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> On 4/16/07, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> > On 4/16/2007 10:13 AM, Gabor Grothendieck wrote:
> > > On 4/16/07, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> > >> On 4/16/2007 7:53 AM, Gregor Gorjanc wrote:
> > >> > Duncan Murdoch wrote:
> > >> >>> I do not have any experience with use of (bash) shell scripts under
> > >> >>> Windows. Sweave.sh can be used with Cygwin, but I am not sure how to use
> > >> >>> shell script without Cygwin. I noticed that some "scripts" in R*/bin
> > >> >>> directory on our Windows machine are perl (build, check, INSTALL, ...)
> > >> >>> and shell (Rd2dvi.sh, Stangle.sh, Sweave.sh, ...) scripts. This
> > >> >>> therefore means that R ships also perl and shell interpreter or am I
> > >> >>> missing something?
> > >> >>
> > >> >> We don't ship Perl or sh.exe, but we do describe how to get them in the
> > >> >> R Admin manual.
> > >> >
> > >> > Maybe I got this totally wrong. Say someone who uses Windows finds R and
> > >> > installs it via setup file. Can he/she launch the folowing without
> > >> > having Perl and/or sh.exe?
> > >> >
> > >> > R CMD script whateverOption
> > >>
> > >> No.  Installing a binary package has a pure R implementation so it
> > >> doesn't need R CMD, but most of the capabilities of R CMD are not
> > >> available with a basic R install.
> > >
> > > Can you just clarify what the dependencies are for
> > >
> > > Rcmd sweave
> > >
> > > where Rcmd is the Rcmd command distributed with R that is run
> > > from the Windows command line.   Does that require perl or other
> > > tools to run?
> >
> > That needs sh.exe, not Perl.  But it's just the equivalent of
> >
> >  echo "library('utils'); Sweave('filename')" | Rterm --no-restore --slave
> >
> > at the command line or
> >
> >  Sweave("filename")
> >
> > in a standard R session.
>
> Thanks for the explanation.  I could look into replacing Rcmd with the Rterm
> pipeline in the sweave.bat script to eliminate the sh.exe dependency so
> sweave.bat can be used with a basic R installation.
>

Actually it turned out to be a relatively simple change so I made it.
Place these two files anywhere in your path on Windows XP:

http://batchfiles.googlecode.com/svn/trunk/sweave.bat
http://batchfiles.googlecode.com/svn/trunk/rterm.bat

and at the Windows XP console type

sweave

for further instructions.  sh.exe should no longer be needed so it should
run with a basic R installation (plus latex and a PDF viewer). I will upload
this to CRAN in the next few days but in the meantime its available as
indicated.



More information about the R-devel mailing list