我有以下代码,它在不使用cache时可以正常工作,但在使用cache=T时无法工作。更改设备也没有任何区别(默认,tikz,cairo)。
为什么会这样呢?你有什么想法吗?
谢谢!
% \SweaveOpts{fig.path=cache/figure/plot-,cache.path=cache/data/data-,fig.align=center,external=TRUE,fig.show=hold,cache=TRUE,echo=FALSE,pdfcrop=TRUE}
<<message=F,fig.width=9,fig.height=6,out.width=\textwidth,cache=F>>=
grid.newpage()
pushViewport(viewport(layout = grid.layout(2,9)))
d <- ncol(rTSc)
p <- ggplot(melt(coveig),aes(1:d,value,group=variable,col=variable)) +
geom_line() + labs(x="index",y="eigenvalue") +
opts(legend.position = "none")
print(p, vp=viewport(layout.pos.row=1,layout.pos.col=1:4))
p <- ggplot(melt(coreig),aes(1:d,value,group=variable,col=variable)) +
geom_line() + labs(x="index",y="eigenvalue")
print(p, vp=viewport(layout.pos.row=1,layout.pos.col=5:9))
p <- ggplot(melt(coveig.cs),aes(1:d,value,group=variable,col=variable)) +
geom_line() + labs(x="index",y="cumulative eigenvalue") +
opts(legend.position = "none")
print(p, vp=viewport(layout.pos.row=2,layout.pos.col=1:4))
p <- ggplot(melt(coreig.cs),aes(1:d,value,group=variable,col=variable)) +
geom_line() + labs(x="index",y="cumulative eigenvalue")
print(p, vp=viewport(layout.pos.row=2,layout.pos.col=5:9))
@
为什么会这样呢?你有什么想法吗?
谢谢!