[R] odfWeave graphics glitch
Prof. John C Nash
nashjc at uottawa.ca
Tue Feb 22 21:17:17 CET 2011
Using R2.12.1 on Ubuntu 10.04.1 I've tried to run the following code chunk in odfWeave
<<fig1, echo=TRUE,fig=TRUE,width=7,height=4>>=
x<-seq(1:100)/10
y<-sin(cos(x/pi))
imageDefs <- getImageDefs()
imageDefs$dispWidth <- 4.5
imageDefs$dispHeight<- 4.5
setImageDefs(imageDefs)
X11(type="cairo")
plot(x,y)
title(main="sin(cos(x/pi))")
savePlot("sincosx.png")
@
This is embedded in file example02in.odt, which has very little else.
In R I run
library(odfWeave)
infile<-"example02in.odt"
outfile<-"ex2.odt"
odfWeave(infile,outfile)
I get the png file created, but the ex2.odt is "corrupted" according to OpenOffice.
On automatic fixup, it does have a frame for a graph, but this is labelled "Read Error".
Note that the vignette for odfWeave has a blank graph too. I've emailed the package
maintainer, but so far no response.
Wondering if it's just my inexperience with this (I manage Sweave OK, but a client is
interested in non-TEX solution). Or perhaps some issue has developed recently that blocks
graphics in odfWeave. Note that some of the stuff in the example (the cairo line for
example) are part of several tries to find a solution.
JN
More information about the R-help
mailing list