*.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
Lyx のみで、ステートメントに応じて
+ scale_y_log10(ylim=c(0.025,5))
次のサンプル コードで:
<<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)
@
下
- openSUSE 11.2、
- TeXlive2010, (今日の時点でインストールされているすべてを更新),
- R バージョン 2.12.1 (2010-12-16) svn rev 53855 (x86_64-unknown-linux-gnu) with update.packages() 本日現在、
- LyX 1.6.8 (TeXLive 更新後に再構成)、
- Yihui Xie のスクリプト ('http://gitorious.org/yihui/lyx-sweave/blobs/raw/master/lyx-sweave-config.R') に従って構成された 2010 年 12 月 18 日の pgfSweave (Yihui に感謝します!)
コードは正常に動作します
- rkwardのRコマンドウィンドウに貼り付けたとき。
- コメントアウトするとlyxで
+scale_y_log10(ylim=c(0.025,5))
私はすでに試しました
sanitize=TRUE
options(device = function(...) { .Call("R_GD_nullDevice", PACKAGE = "grDevices") })
と
dev.off()
( http://www.inside-r.org/questions/problems-ggplot-and-pgfsweaveで提案)
これはどれも役に立ちません。お願いします!