[R] Sweave

R Heberto Ghezzo, Dr heberto.ghezzo at mcgill.ca
Fri Feb 12 20:28:53 CET 2010


Thanks to Prof Ripley, I modified Rprofile.site with:

.First <- function() {
 Sys.setenv("JAGS_HOME"=replace.substring.wild(R.home(), "R-*", "JAGS-1.0.3"))
Sys.setenv("LATEX"=replace.substring.wild(R.home(),"R*","PortableUSB/PortableApps/MikeTex/miktex/bin/latex.exe"))
PathNew <- paste(Sys.getenv("PATH"),";",replace.substring.wild(R.home(),"R*","PortableUSB/PortableApps/MikeTex/miktex/bin"),sep="")
 Sys.setenv("PATH"=PathNew)
 }

 Sorry I mispelled MikTex with MikeTex!!, it is MixTex Portable
 but now I get
 
> tools::texi2dvi("Sweave-test-1.tex", pdf=TRUE)
Error in tools::texi2dvi("Sweave-test-1.tex", pdf = TRUE) :
  running 'texi2dvi' on 'Sweave-test-1.tex' failed
LaTeX errors:
E:/R/R-2.10.0/etc/Sweave-test-1.tex:66: Undefined control sequence
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
E:/R/R-2.10.0/etc/Sweave-test-1.tex:67: Undefined control sequence
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
E:/R/R-2.10.0/etc/Sweave-test-1.tex:67: Extra }, or forgotten $
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
E:/R/R-2.10.0/etc/Sweave-test-1.tex:68: Missing $ inserted
I've inserted
>
which would indicate an error in Sweave, the file used is
the file included with R-2.10.0
I am using Windows 7 in a Toshiba Satellite laptop

 Heberto Ghezzo
 McGill University
 Montreal - Canada


More information about the R-help mailing list