I encounter the following error in the *.Rnw.log:
Error: chunk 3 (label=printgraph)
Error in grid.Call.graphics("L_text", as.graphicsAnnot(x$label), x$x, :
Metric information not available for this family/device
only in Lyx and depending upon the statement
+ scale_y_log10(ylim=c(0.025,5))
in the following sample code:
<<Code, tidy=T, sanitize=TRUE>>=
require(ggplot2)
df.qdf=data.frame(T = c(0 ,1,2 ,0 ,1.5,2.5)
,q.500 = c(0.025,2,1 ,0.025, 4,2 )
,q.025 = 0.5*c(0.025,2,1 ,0.025, 4,2 )
,q.975 = 1.5*c(0.025,2,1 ,0.025, 4,2 )
,Occasion = c( 1,1,1 ,2 , 2,2 )
)
theme_set(theme_bw())
Graph=(qplot(T,q.500,data=df.qdf)
+geom_smooth(aes(ymin=q.025,ymax=q.975)
,data=df.qdf
,stat='identity'
,fill='blue')
+ylab('Response')
+xlab('Time [h]')
+facet_grid(facet=.~Occasion)
) +scale_y_log10(ylim=c(0.025,5))
@
<<printgraph,echo=FALSE,fig=TRUE,width=10,height=7,sanitize=TRUE>>=
print(Graph)
@
under
- openSUSE 11.2,
- TeXlive2010, (update all installed as of today),
- R version 2.12.1 (2010-12-16) svn rev 53855 (x86_64-unknown-linux-gnu) with update.packages() as of today,
- LyX 1.6.8 (reconfigured after TeXLive update),
- pgfSweave of 18 December 2010 as configured according to Yihui Xie's script ('http://gitorious.org/yihui/lyx-sweave/blobs/raw/master/lyx-sweave-config.R') (Thank you Yihui!)
The code works ok
- when pasted in the R-command window of rkward.
- in lyx when I comment out the
+scale_y_log10(ylim=c(0.025,5))
I have tried already
sanitize=TRUE
options(device = function(...) { .Call("R_GD_nullDevice", PACKAGE = "grDevices") })
and
dev.off()
(suggested in http://www.inside-r.org/questions/problems-ggplot-and-pgfsweave)
None of this helps. Please!