【问题标题】:RStudio v0.97 on Windows 7 64bit -- color2D.matplot will not knit to html, using RmarkdownWindows 7 64bit 上的 RStudio v0.97 -- color2D.matplot 不会使用 Rmarkdown 编织到 html
【发布时间】: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


【解决方案1】:

在调用函数color2D.matplot()之前使用library(plotrix)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-26
    • 1970-01-01
    • 2014-08-10
    • 2018-05-18
    • 2013-12-01
    • 2019-03-11
    相关资源
    最近更新 更多