Hi, I need some opinion. I would like to use graph that I generate from R code and save it into word document. Which format is better? pdf, jpeg or tiff? Thank you. [[alternative HTML version deleted]]
PNG is better for black and white graphs, tiff better for more colors, but gives a big file. JPG has a lossy compression, and is good with detailed colors (like photos) if you want a smaller file. You can't import (AFAIK) a PDF into word. On 19 August 2010 20:32, Roslina Zakaria <zroslina at yahoo.com> wrote:> Hi, > > I need some opinion.? I would like to use graph that I generate from R code and > save it into word document.? Which?format is better? pdf, jpeg or tiff? > > Thank you. > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > 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. > >-- Jeremy Miles Psychology Research Methods Wiki: www.researchmethodsinpsychology.com
I use Rgui and copy/paste special windows metafile. "Roslina Zakaria" <zroslina at yahoo.com> wrote:>Hi, > >I need some opinion.? I would like to use graph that I generate from R code and >save it into word document.? Which?format is better? pdf, jpeg or tiff? > >Thank you. > > > > [[alternative HTML version deleted]] > >______________________________________________ >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.--------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity.
From my experience, *.pdf is the best of the three file formats. On Aug 19, 2010, at 8:32 PM, Roslina Zakaria wrote: Hi, I need some opinion. I would like to use graph that I generate from R code and save it into word document. Which format is better? pdf, jpeg or tiff? Thank you. [[alternative HTML version deleted]] ______________________________________________ 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.
Hi Rosalina, I created simple barplots with R and saved them as jpeg oder png. I wanted to use them in a LaTex-beamer presentation. The results were simply awful. They looked like if I had copied them out of some other document, thus "losing" most of the resolution. However, saving the plot as pdf and using this in the beamer-presentation worked like a charm and the resolution was super-sharp. This is probably the point that Tim Gruene highlighted directly at the beginning in his answer. Which format would be the best to integrate into Word? Unfortunately, I have no experience on that one. My suggestion would be to create a sample graph in either of the formats and see what they look like compared to each other. I mean, it's your document and it should be pleasant to you at first ;) If you should want to modify the plots later via some graphics-program (GIMP, Photoshop, you name it...), clearly pdfs are not widely, if they are at all, directly supported, so you must convert it to a different format like jpeg or png then... Best, Cedric On Friday, 20. August 2010 05:32:46 Roslina Zakaria wrote:> Hi, > > I need some opinion. I would like to use graph that I generate from R code > and save it into word document. Which format is better? pdf, jpeg or > tiff? > > Thank you. > > > > [[alternative HTML version deleted]]
On Thu, 2010-08-19 at 20:32 -0700, Roslina Zakaria wrote:> Hi, > > I need some opinion. I would like to use graph that I generate from R code and > save it into word document. Whichformat is better? pdf, jpeg or tiff?Not that I have used word for a while myself, but when I did EPS files were my preferred format for Word docs that were to be printed or converted to PDF. The only downside is that Word's EPS importer displays a low resolution bitmap image of the EPS in the document so things look pretty sketchy on screen. When printed, however, EPS images will provide top quality. To achieve the same quality with JPEG or TIFF would require a much larger image file and consequently a much larger final document. I still send my Word-using colleagues EPS files for papers we are writing etc. ?postscript for the options needed to produce correct EPS. HTH G> > Thank you. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> Which?format is better? pdf, jpeg or tiff?png and jpeg are bitmap formats, and you can trigger the resolution playing with options width, height (in pixels) and res (nominal DPI) till you find what is suitable for your purpose. Png is definitely the way to go for graphs. Pdf is the overall best option IMHO, but as already pointed out, word cannot deal with it. scion
I use savePlot() with type="emf" (remember to include the right file extension - although savePlot will use the type as default extension, it will only do so if there are no '.'s in the filename, so filenames like '../plots/aplot' won't get the extension automatically. Really should have made that check an extension check!). .emf format is a native format for windows vector graphics on a windows system, so Word imports .emf files directly. I would not use the older .wmf format, though; scaling seems to have gone badly awry for .wmf from R. No idea why as I assume R uses native windows calls to generate them. Like others, I would not recommend jpg, png or tiff for import into word-processing softeare; you either get oversized files or poor reproduction and scaling. Steve E>>> Duncan Murdoch <murdoch.duncan at gmail.com> 20/08/2010 09:27:53 >>>On 20/08/2010 1:58 AM, Jeff Newmiller wrote:> I use Rgui and copy/paste special windows metafile.******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}