【发布时间】:2012-12-18 00:35:08
【问题描述】:
我正在尝试在 Rstudio 中使用 Rmarkdown 将以下绘图生成为 html 文档:
color2D.matplot(M,cs1=c(0,1),cs2=c(0,1),cs3=c(0,1),
extremes=c(1,3),cellcolors=NA,show.legend=TRUE,nslices=10,xlab="Base Price (R)",
ylab="GP (%)",do.hex=FALSE,axes=FALSE,show.values=FALSE,vcol=NA,vcex=1,
border="black",na.color=NA,xrange=NULL,color.spec="rgb",yrev=TRUE,
xat=NULL,yat=NULL,Hinton=FALSE)
但我收到以下错误:
## Error: could not find function "color2D.matplot"
但是,绘图在 Rstudio 的“绘图”显示中完美生成。有什么办法可以让 Rmarkdown 找到函数并显示输出吗?谢谢
【问题讨论】:
-
您能否提供
M的样本,以便我们重现此内容?一个不错的方法是运行dput(M)。 -
我认为您只需在块中添加
require(plotrix)。
标签: r knitr rstudio r-markdown