Dieter Menne
2010-Oct-03 10:04 UTC
[R] Include externally generated pdf in output (without Sweave)
Dear useRs, I generated a simple image-based report using the sequence: pdf(....) plot(.....) textplot( for short texts, from gplots) dev.off() Is there an easy way to include an single pdf-page from an external file (not R generated). Note: For final reports, I know how to use Sweave, but I am looking for a quick solution with less overhead. Something like textplot() for pdf. Dieter
Tal Galili
2010-Oct-03 12:52 UTC
[R] Include externally generated pdf in output (without Sweave)
Hello Dieter, Looking at this thread (from 2005) http://tolstoy.newcastle.edu.au/R/help/05/10/14320.html It seems you can't read a pdf file to R (at least then, I hope there was an update since). BUT You could potentially read an image file (like, for example, tiff) using something like read.picture {SoPhy} And then write that into the PDF you are creating in R. The best thing is if there was some function to read a vector file into R (and not only the pixel). Maybe such a function exits, you should check. Either way, great question. Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Sun, Oct 3, 2010 at 12:04 PM, Dieter Menne <dieter.menne@menne-biomed.de>wrote:> Dear useRs, > > I generated a simple image-based report using the sequence: > > pdf(....) > plot(.....) > textplot( for short texts, from gplots) > dev.off() > > Is there an easy way to include an single pdf-page from an external file > (not R generated). > > Note: For final reports, I know how to use Sweave, but I am looking for a > quick solution with less overhead. Something like textplot() for pdf. > > > Dieter > > ______________________________________________ > 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. >[[alternative HTML version deleted]]
Dieter Menne
2010-Oct-03 13:38 UTC
[R] Include externally generated pdf in output (without Sweave)
Tal Galili wrote:> > You could potentially read an image file (like, for example, tiff) using > something like > read.picture {SoPhy} >Thanks to you and Baptiste Auguie. Looks like the best way would be to import the picture as a pixel graphics with "read.picture". It might be possible to read ps with grImport (Murells/suggested by Baptiste), but I always found the postscript-detour messy. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Include-externally-generated-pdf-in-output-without-Sweave-tp2953057p2953182.html Sent from the R help mailing list archive at Nabble.com.
Greg Snow
2010-Oct-04 18:39 UTC
[R] Include externally generated pdf in output (without Sweave)
Importing as pixel image then replotting will probably reduce the quality of the graph. Another approach is to use the pdftk program (I have seen versions for unix and windows) to add/insert the original pdf page into your document. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Dieter Menne > Sent: Sunday, October 03, 2010 7:39 AM > To: r-help at r-project.org > Subject: Re: [R] Include externally generated pdf in output (without > Sweave) > > > > Tal Galili wrote: > > > > You could potentially read an image file (like, for example, tiff) > using > > something like > > read.picture {SoPhy} > > > > Thanks to you and Baptiste Auguie. Looks like the best way would be to > import the picture as a pixel graphics with "read.picture". It might be > possible to read ps with grImport (Murells/suggested by Baptiste), but > I > always found the postscript-detour messy. > > Dieter > > > -- > View this message in context: http://r.789695.n4.nabble.com/Include- > externally-generated-pdf-in-output-without-Sweave- > tp2953057p2953182.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.