Unfortunately the win.metafile() device does not support semi-transparent
colours, which I like using.
In my experience, the best way to get R graphics into Word is to use compressed
high-resolution tiff, like this:
word.tif = function(filename="Word_Figure_%03d.tif", zoom=4, width=17,
height=10, pointsize=10, ...) {
if (!grepl("[.]ti[f]+$", filename, ignore.case=TRUE))
filename = paste0(filename,".tif")
tiff(filename=filename, compression="lzw", res=96*zoom,
width=width, height=height, units='cm', pointsize=pointsize, ...)
}
word.tif('test')
plot(rnorm(100))
dev.off()
Now drag the file test.tif into your Word document.
Sure, it's a bitmap format rather than a vector format, but the quality is
excellent and the file sizes are still quite small. None of the vector formats
works as well as this.
cheers,
Steve
______________________________________________
[email protected] 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.