Re: [R] Sweave doesn't work
Hi Daniele, _ in dati_england is treated as a special character in LaTeX math mode and causes your LaTeX-compiler trying to switch to math mode (you might have noticed a warning abaout missing `$' inserted). To produce a plain _ in TeX you have to mask it as \_. Package Hmisc has some sanitization methods for that task, but you can do that easily by hand using gsub. Cheers. Am 21.08.2011 18:18, schrieb danielepippo: Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave(example.Rtex) in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data- read.csv(C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV@BeginScanning. inserted text \par * ...le/Desktop/dati/LaTeX1.Rtex* The Sweave code in Latex is like this: *\begin{Scode}{echo=FALSE} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Scode} \begin{figure}[!h] \centering \begin{Scode}{fig=TRUE, width=6, height=9, echo=FALSE} data1=matrix(0,ncol=4,nrow=4) \end{Scode} \caption{Data} \end{figure}* I don't know how to fix this problem. Any advices? Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/Sweave-doesn-t-work-tp3758658p3758658.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave doesn't work
Hi Eik, On Mon, Aug 22, 2011 at 4:14 AM, Eik Vettorazzi e.vettora...@uke.uni-hamburg.de wrote: Hi Daniele, _ in dati_england is treated as a special character in LaTeX math mode and causes your LaTeX-compiler trying to switch to math mode (you might have noticed a warning abaout missing `$' inserted). To produce a plain _ in TeX you have to mask it as \_. Package Hmisc has some This is true in the regular environment, but should not be true for code. Think about all the special characters encountered in R code--- $, quotes, _ ^. The following minimal document compiles fine on my system: \documentclass{article} \usepackage{Sweave} \begin{document} \section{Example showing underscores works fine inside an Schunk} \begin{Schunk} \begin{Sinput} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Sinput} \end{Schunk} \end{document} producing the attached PDF. My system: R Under development (unstable) (2011-08-13 r56733) Platform: x86_64-pc-mingw32/x64 (64-bit) Version 0.3 r.670 (MiKTeX 2.9) Josh sanitization methods for that task, but you can do that easily by hand using gsub. Cheers. Am 21.08.2011 18:18, schrieb danielepippo: Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave(example.Rtex) in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data- read.csv(C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV@BeginScanning. inserted text \par * ...le/Desktop/dati/LaTeX1.Rtex* The Sweave code in Latex is like this: *\begin{Scode}{echo=FALSE} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Scode} \begin{figure}[!h] \centering \begin{Scode}{fig=TRUE, width=6, height=9, echo=FALSE} data1=matrix(0,ncol=4,nrow=4) \end{Scode} \caption{Data} \end{figure}* I don't know how to fix this problem. Any advices? Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/Sweave-doesn-t-work-tp3758658p3758658.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/ example.pdf Description: Adobe PDF document __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave doesn't work
Hi Josh, you are absolutly right. Thanks for pointing that out. It is the Scode- environment which causes the error in TeX. @Daniele: have a look at the Sweave user manual (page 7ff) and try Sweave('example.Rtex',syntax=SweaveSyntaxLatex) Your Scode block should not be asterisked. I don't know if this is the case in your primary Sweave-file since you only provided the LaTeX output... Cheers Am 22.08.2011 16:14, schrieb Joshua Wiley: Hi Eik, On Mon, Aug 22, 2011 at 4:14 AM, Eik Vettorazzi e.vettora...@uke.uni-hamburg.de wrote: Hi Daniele, _ in dati_england is treated as a special character in LaTeX math mode and causes your LaTeX-compiler trying to switch to math mode (you might have noticed a warning abaout missing `$' inserted). To produce a plain _ in TeX you have to mask it as \_. Package Hmisc has some This is true in the regular environment, but should not be true for code. Think about all the special characters encountered in R code--- $, quotes, _ ^. The following minimal document compiles fine on my system: \documentclass{article} \usepackage{Sweave} \begin{document} \section{Example showing underscores works fine inside an Schunk} \begin{Schunk} \begin{Sinput} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Sinput} \end{Schunk} \end{document} producing the attached PDF. My system: R Under development (unstable) (2011-08-13 r56733) Platform: x86_64-pc-mingw32/x64 (64-bit) Version 0.3 r.670 (MiKTeX 2.9) Josh sanitization methods for that task, but you can do that easily by hand using gsub. Cheers. Am 21.08.2011 18:18, schrieb danielepippo: Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave(example.Rtex) in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data- read.csv(C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV@BeginScanning. inserted text \par * ...le/Desktop/dati/LaTeX1.Rtex* The Sweave code in Latex is like this: *\begin{Scode}{echo=FALSE} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Scode} \begin{figure}[!h] \centering \begin{Scode}{fig=TRUE, width=6, height=9, echo=FALSE} data1=matrix(0,ncol=4,nrow=4) \end{Scode} \caption{Data} \end{figure}* I don't know how to fix this problem. Any advices? Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/Sweave-doesn-t-work-tp3758658p3758658.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Eik Vettorazzi Institut für Medizinische Biometrie und Epidemiologie Universitätsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Sweave doesn't work
Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave(example.Rtex) in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data- read.csv(C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV@BeginScanning. inserted text \par * ...le/Desktop/dati/LaTeX1.Rtex* The Sweave code in Latex is like this: *\begin{Scode}{echo=FALSE} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Scode} \begin{figure}[!h] \centering \begin{Scode}{fig=TRUE, width=6, height=9, echo=FALSE} data1=matrix(0,ncol=4,nrow=4) \end{Scode} \caption{Data} \end{figure}* I don't know how to fix this problem. Any advices? Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/Sweave-doesn-t-work-tp3758658p3758658.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave doesn't work
Hi, You would probably be better off providing us with the code you weave rather than the TeX code. Also, the problem is quite possibly not near where the error occurred. In my (admittedly limited) experience, runaway argument issues tend to mean at some earlier point I: A) did not choose the right environment B) did not close an environment C) did not properly escape something leading essentially to A or B Something seems weird to me with the LaTeX code you show though. In addition to posting your code (not the TeX output), it would also be good to post your version of R. Cheers, Josh On Sun, Aug 21, 2011 at 9:18 AM, danielepippo dan...@hotmail.it wrote: Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave(example.Rtex) in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data- read.csv(C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV@BeginScanning. inserted text \par * ...le/Desktop/dati/LaTeX1.Rtex* The Sweave code in Latex is like this: *\begin{Scode}{echo=FALSE} data- read.csv(c:\\Users\\Daniele\\Desktop\\dati\\dati_england.csv,header=T,sep=,) \end{Scode} \begin{figure}[!h] \centering \begin{Scode}{fig=TRUE, width=6, height=9, echo=FALSE} data1=matrix(0,ncol=4,nrow=4) \end{Scode} \caption{Data} \end{figure}* I don't know how to fix this problem. Any advices? Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/Sweave-doesn-t-work-tp3758658p3758658.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, ATS Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave doesn't work
On Sun, Aug 21, 2011 at 09:18:25AM -0700, danielepippo wrote: Sweave(example.Rtex) in R it seems working [...] * ...le/Desktop/dati/LaTeX1.Rtex* Sounds like you are first running sweave on the file 'example.Rtex' and later LaTex on 'LaTeX1.Rtex' Two points: 1) why do these files have totally differnt names? If the Sweave file was called 'example.Rtex' I'd expect the corresponding LaTex file to be 'example.tex' 2) Why to both files have the same extension? Commonly, the Sweave files are called 'something.Snw' or 'something.Rnw' and the resulting LaTex Files would be 'something.tex' cu Philipp __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.