Kevin Thorpe
2021-Feb-18 18:12 UTC
[R] ISO recommendations for plot output format from R to MS Word
I did not see the original thread so this may have been discussed. I would think that it would be more seamless to use Rmarkdown. Simply put the plotting code into an Rmarkdown file and send it straight to Word. Is there a reason why this is not a viable option? -- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016> On Feb 18, 2021, at 12:50 PM, Robert Dodier <robert.dodier at gmail.com> wrote: > > EXTERNAL EMAIL: > > Hi, a quick follow-up about the question about putting R-generated > figures into MS Word. > > I have found by experimenting with some figures and documents that if > I import an SVG figure generated by svglite (didn't try other output > functions), I can view it okay in my installation of MS Word (Word for > Mac 16.16.10), and it looks okay in MS Word for Windows (circa 2016 or > 2018) on a laptop I have, and two other people can view it okay (one > on Mac and one on Windows). So that seems safe enough to go ahead. > YMMV. > > I am informed that MS Word is actually storing a bitmap image of the > SVG figure, which is displayed by non-SVG-aware versions of Word. So > that seems like a good safeguard. > > For the record, I converted the SVG to EPS, PNG, PDF, WMF, and EMF via > Imagemagick. EPS and PNG were tolerable, PDF was too fuzzy, and WMF > and EMF, at least as generated, could not be displayed (I was a little > surprised by that). There are, no doubt, many unanswered questions > here, which unfortunately I cannot take the time to explore right now. > > In summary I found that importing SVG generated by svglite into MS > Word for Mac seems to work okay to generate a generally-readable file. > Perhaps this experience is useful in some way to others. > > best, > > Robert Dodier > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Robert Dodier
2021-Feb-18 19:03 UTC
[R] ISO recommendations for plot output format from R to MS Word
On Thu, Feb 18, 2021 at 10:12 AM Kevin Thorpe <kevin.thorpe at utoronto.ca> wrote:> I would think that it would be more seamless to use Rmarkdown. > Simply put the plotting code into an Rmarkdown file and send it > straight to Word. Is there a reason why this is not a viable option?Hi Kevin, thanks for your reply. Well, I started working with Word because at least one other person needs to edit it and they want to use Word. More fundamentally, it's not clear to me that going through Rmarkdown solves the problem of determining the image format -- at some point a figure is going to get generated and then pasted into a Word document. It's not clear that doing that automatically is going to work better or differently than doing it by hand. Anyway I think I have a working solution at this point so I leave it to others to investigate further possibilities. best, Robert Dodier