Re: [R] Sweave files into LaTex
Thanks Michael. That worked perfect! Best Axel. On Sat, Apr 5, 2014 at 2:13 PM, Michael Friendly frien...@yorku.ca wrote: If you use knitr, you can do, in master.Rnw Rcode, child=Rcode.Rnw= @ This is the equivalent of \input{} (but not \include{}) at the .Rnw level. At any rate, if you have more than just a few code chunks, you should do your work in master.Rnw and produce master.tex from that using either sweave() or knitr() -M On 4/4/2014 7:10 PM, Axel Urbiz wrote: Hi, I'm writing a thesis in Latex (say master.tex). I'd like to include R code/results from an .Rwd file. I've naively tried: 1) Add ONLY the code below in Rcode.Rnw file: \section{Exploratory data analysis} eval=TRUE, echo=FALSE= library(ggplot2) data(diamonds) head(diamonds) @ 2) Then, in the master.tex file add the following line: \include{Rcode.Rnw} But of course, that didn't work.Any help would be much appreciated. Best, Axel. [[alternative HTML version deleted]] -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA [[alternative HTML version deleted]] __ 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 files into LaTex
If you use knitr, you can do, in master.Rnw Rcode, child=Rcode.Rnw= @ This is the equivalent of \input{} (but not \include{}) at the .Rnw level. At any rate, if you have more than just a few code chunks, you should do your work in master.Rnw and produce master.tex from that using either sweave() or knitr() -M On 4/4/2014 7:10 PM, Axel Urbiz wrote: Hi, I'm writing a thesis in Latex (say master.tex). I'd like to include R code/results from an .Rwd file. I've naively tried: 1) Add ONLY the code below in Rcode.Rnw file: \section{Exploratory data analysis} eval=TRUE, echo=FALSE= library(ggplot2) data(diamonds) head(diamonds) @ 2) Then, in the master.tex file add the following line: \include{Rcode.Rnw} But of course, that didn't work.Any help would be much appreciated. Best, Axel. [[alternative HTML version deleted]] -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA __ 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 files into LaTex
Hi, I'm writing a thesis in Latex (say master.tex). I'd like to include R code/results from an .Rwd file. I've naively tried: 1) Add ONLY the code below in Rcode.Rnw file: \section{Exploratory data analysis} eval=TRUE, echo=FALSE= library(ggplot2) data(diamonds) head(diamonds) @ 2) Then, in the master.tex file add the following line: \include{Rcode.Rnw} But of course, that didn't work.Any help would be much appreciated. Best, Axel. [[alternative HTML version deleted]] __ 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 files into LaTex
On 04/04/2014, 7:10 PM, Axel Urbiz wrote: Hi, I'm writing a thesis in Latex (say master.tex). I'd like to include R code/results from an .Rwd file. I've naively tried: 1) Add ONLY the code below in Rcode.Rnw file: \section{Exploratory data analysis} eval=TRUE, echo=FALSE= library(ggplot2) data(diamonds) head(diamonds) @ 2) Then, in the master.tex file add the following line: \include{Rcode.Rnw} But of course, that didn't work.Any help would be much appreciated. You want \include{Rcode.tex} But you have to run Sweave to produce Rcode.tex from Rcode.Rnw. The patchDVI package has functions to make this easy if you're using TeXWorks or some other LaTeX editors -- see the vignette. Duncan Murdoch __ 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.