【问题标题】:Markdown Report Not Executing in RstudioMarkdown 报告未在 Rstudio 中执行
【发布时间】:2013-04-01 22:30:38
【问题描述】:

我正在生成错误:

> options(encoding='UTF-8'); require(knitr); knit('March-2013-Report.Rmd');
Loading required package: knitr


processing file: March-2013-Report.Rmd
  |......................                                           |  33%
  ordinary text without R code

  |...........................................                      |  67%
label: unnamed-chunk-1
Quitting from lines 4-5 (March-2013-Report.Rmd) 
Error in evaluate(code, envir = env, new_device = FALSE, stop_on_error = if (options$include) opts_knit$get("stop_on_error") else 2L) : 
  unused argument(s) (new_device = FALSE, stop_on_error = if (options$include) opts_knit$get("stop_on_error") else 2)
Calls: knit ... process_group.block -> call_block -> block_exec -> in_dir -> evaluate

Execution halted

knitr terminated with status 1

当使用 RStudio 编织 .Rmd 文件中包含的以下代码时:

March 2013 - UGA Google Analytics Report
========================================================

```{r}
2+2
```



## About this Report


## Future Vision for GA and Web Reporting


## Analysis



### Basic Page Stats

我通常可以调试我的错误并确定这是显而易见的,但我做错了什么以及为什么不能编译?

提前致谢。

更新:会话信息

> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plyr_1.7.1      stringr_0.6.1   rga_0.8         httr_0.2        lubridate_1.2.0
[6] rjson_0.2.10    RCurl_1.95-1.1  bitops_1.0-4.1 

loaded via a namespace (and not attached):
[1] codetools_0.2-8 digest_0.5.2    evaluate_0.4.2  formatR_0.6     knitr_1.1.8    
[6] tools_2.15.0  

【问题讨论】:

  • 它对我来说编织得很好。你的包/RStudio 是最新的吗?
  • 也适合我。您可能需要提供sessionInfo()
  • 已发布会话信息。再次感谢
  • 虽然这里可能没关系(真正的原因在答案下方的评论中解释过),但我建议你也升级RStudio,因为我在日志中看到了options(encoding='UTF-8'),即不是设置编码的正确方法,已修复。

标签: r markdown knitr rstudio r-markdown


【解决方案1】:

我猜这是过时软件包的问题。可以试试更新吗?在 RStudio 中,在 packages 选项卡下,您应该可以选择更新任何需要的软件包。

【讨论】:

  • 具体来说是evaluate包过时了(#400)。
【解决方案2】:

尝试清除 knitr 缓存 - 如果任何块有 cache=TRUE

我通常在编织时遇到这个问题,其中一些代码块有cache=TRUE

【讨论】:

    猜你喜欢
    • 2013-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-24
    • 1970-01-01
    • 2019-11-19
    相关资源
    最近更新 更多