[R] Lattice + Word: Changing .wmf files to .pdf files
price_ja at hotmail.com
Wed Jun 4 19:10:31 CEST 2008
My apriori apologies if this is felt to be the wrong list for this issue -
although it starts with R, it's a combination of programs that creates the
Currently we are using windows metafile format for in-text tables for
reports created in Word. However, we've discovered some artifactual lines
being created in our final output once the Word document is changed to PDF.
The process is as follows:
# Simplest example code that contains all the sample features that create
test <- expand.grid(type = paste('Type', 1:4), success = c('Yes','No'))
test$result <- exp(rnorm(nrow(test)))
success ~ result | type,
data = test,
panel = function(...)
panel.abline(v = 0, lty = 2)
xlim = c(-10, 10)
This is then imported into Word 2008 (running on XP Pro 2002 with service
pack 2) using the import picture tool. The resulting file is then saved as a
PDF from Word.
Although the .wmf file (and R console output if sent to there) look exactly
as you'd expect, there are a series of diagonal lines running from the
bottom of the panel.abline created index line to the upper bound of each
I confess to being somewhat confused - if windows metafile formats and PDF
are both vector graphic formats, I'm not sure where this extra line has come
from. I suspect it may be an artifact from Word's PDF creating routine, but
have no concrete proof of this.
If any one can shed enlightenment (or suggest an alternative approach that
preserves decent fidelity - we've struggled with postscript files in the
past, but this may be our opportunity to try them out again), it would be
R version 2.7.0 (2008-04-22)
attached base packages:
 stats graphics grDevices utils datasets methods base
other attached packages:
loaded via a namespace (and not attached):
Cardiome Pharma Corp.
View this message in context: http://www.nabble.com/Lattice-%2B-Word%3A-Changing-.wmf-files-to-.pdf-files-tp17651766p17651766.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help