2016-02-17 293 views
0

随着knitr我尝试的产品,并与c.trellis()结合两个lattice地块,但不是预期的组合情节,我得到什么样子的结合网格物体的内部表示:如何让knitr与c.trellis一起工作?

enter image description here

MWE:

--- 
title: "Knitr and c.trellis" 
author: "David Lindelöf" 
date: "17 February 2016" 
output: pdf_document 
--- 

```{r} 
foo <- xyplot(1 ~ 1) 
bar <- xyplot(2 ~ 1) 
c(foo, bar) 
``` 

我也尝试在单独的块中调用print(c(foo, bar)),但没有成功。我做错了什么,或者这是knitr的问题?

+0

啊,明白了。我忘记了调用'library(latticeExtra)'来定义'c()'的'trellis'方法。 – lindelof

回答

0

我忘记了包含library(latticeExtra)的呼叫,该呼叫定义了c.trellis()方法。

+0

如果解决了您的问题,您可以[接受您自己的答案](http://stackoverflow.com/help/self-answer)。 (编辑:刚刚意识到你的12k声望,你可能知道......) –