I am new to R and RStudio. I am using a sweave template to compile a pdf file when i finish the R code. However, it generated a new pdf called Rplot.pdf to save all graphics separately from the original file? How could I combine the two pdf into one? Any helps will be appreciated. My work environment is Windows 7/R 2.14/R Studio 0.94/ProTeXt3.0. Also, I could access a web based RStudio set up by our department. -- View this message in context: http://r.789695.n4.nabble.com/Compiling-graphics-into-the-same-PDF-file-tp4560586p4560586.html Sent from the R help mailing list archive at Nabble.com.
Hi, Please read the Sweave documentation. A good starting place is http://www.statistik.lmu.de/~leisch/Sweave/Sweave-manual.pdf -- there you will learn to use fig=TRUE and many other useful things. Best, Ista On Mon, Apr 16, 2012 at 12:37 AM, damiloveu <wuyi.li at live.com> wrote:> I am new to R and RStudio. ?I am using a sweave template to compile a pdf > file when i finish the R code. ?However, it generated a new pdf called > Rplot.pdf to save all graphics separately from the original file? How could > I combine the two pdf into one? > > Any helps will be appreciated. > > My work environment is Windows 7/R 2.14/R Studio 0.94/ProTeXt3.0. Also, I > could access a web based RStudio set up by our department. > > -- > View this message in context: http://r.789695.n4.nabble.com/Compiling-graphics-into-the-same-PDF-file-tp4560586p4560586.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.
Thanks, Ista. I inserted fig=TRUE to the chunk and it did work. However, it generated each plot into separate files in the directory as well. I have much more to learn soon. Wuyi -- View this message in context: http://r.789695.n4.nabble.com/Compiling-graphics-into-the-same-PDF-file-tp4560586p4561702.html Sent from the R help mailing list archive at Nabble.com.
Just FYI: if you use the knitr package (http://yihui.name/knitr/demo/rstudio/), you do not need fig=TRUE; knitr will not create Rplots.pdf either. For the plot files, I do not understand why they should not be generated -- how is LaTeX supposed to insert them into the final PDF output if they are not generated? Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Apr 16, 2012 at 9:31 AM, damiloveu <wuyi.li at live.com> wrote:> Thanks, Ista. > > I inserted fig=TRUE to the chunk and it did work. However, it generated each > plot into separate files in the directory as well. > > I have much more to learn soon. > > > Wuyi >