[ESS] slowness problem

Kevin Wright kwright68 at gmail.com
Thu Sep 7 17:15:17 CEST 2006


I have taken a slightly different approach on windows and wrote a
couple of R functions that let me process the Rnw file from R.  The
'texify' function expects to find Cygwin's bash shell in the current
PATH.

weave <- function(filename){
  # Author: Kevin Wright

  # Jump through hoops to accept weave(blups) or weave("blups")
  if(as.character(match.call()$filename)!="filename")
    filename <- as.character(substitute(filename))
  Sweave(paste(filename,".rnw",sep=""),
         output=paste(filename,".tex",sep=""))
}

texify <- function(filename){
  # Author: Kevin Wright

  # Jump through hoops to accept texify(blups) texify("blups")
  if(as.character(match.call()$filename)!="filename")
    filename <- as.character(substitute(filename))
  # We should check to see if the tex file exists...
  if(file.exists(paste(filename,".tex",sep=""))){
    shellstring <- paste("'texify -p --run-viewer ",filename,".tex'",sep="")
    shell(shellstring,flag="-c")
  } else {
    cat("Cannot find ",filename,"\n",sep="")
  }
}



On 9/7/06, Rodney Sparapani <rsparapa at mcw.edu> wrote:
> Gregor Gorjanc wrote:
> >
> >>> I tried it and it is a little faster. I will follow the A.J. Rossini
> >>> advice, i.e. I will learn how to use an batch approach to run Sweave on
> >>> Windows because I have never done it. I will find how to use the
>
> > Until this is published here is the content of src/gnuwin32/fixed/bin/Sweave.sh.
> > I do not how this can be used in windows, but others on this list or R-help list
> > might help
> >
> > R_EXE="${R_HOME}/bin/rterm.exe"
> > echo "library(\"utils\"); Stangle(\"$1\")" | \
> >   "${R_EXE}" --no-save --no-restore --quiet
> >
> > Gregor
> >
>
> On Windows, there is some POSIX shell functionality, but I have never
> seen anyone use that.  Most people who are doing this kind of thing have
> installed Cygwin or the MKS Toolkit.  For the rest of the Windows
> masses, it would have to be something like (really rusty since I haven't
> done NT or OS/2 programming this millennium):
>
> rem Sweave.cmd
> set R_EXE="%R_HOME%\bin\rterm.exe"
> echo library("utils"); Stangle("%1%") | %R_EXE% --no-save --no-restore
> --quiet
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>




More information about the ESS-help mailing list