knitr:将Rmd文件转换为HTML时,R中出现parse_all错误 [英] knitr: getting a parse_all error in R when converting Rmd file into HTML
问题描述
每次在R中使用Knit Html将Rmd文件转换为HTML时,我都低于解析错误:
I am getting below Parsing error each time I use Knit Html in R for converting my Rmd files into HTML:
parse_all(输入,文件名,stop_on_error!= 2L)中的错误:未使用 参数(stop_on_error!= 2)调用:... call_block-> block_exec-> in_dir->评估-> parse_all
Error in parse_all(input, filename, stop_on_error != 2L) : unused argument (stop_on_error != 2) Calls: ... call_block -> block_exec -> in_dir -> evaluate -> parse_all
执行停止
从命令行使用knitr或knitr:knit2html可获得相同的结果.错误以前不存在(我已经为许多.Rmd报告使用了Knit HTML),但是当我第一次使用cmd中的knit2html时出现了错误.只有在.Rmd文件中没有R代码块或块为空的情况下,编译才有效.我在Windows 7下工作,R版本:3.2.3,R Studio版本:0.99.902.以下是我用于测试的test.Rmd文件中唯一的R代码块:
Same result is obtained when using knitr or knitr:knit2html from the command line. Error did not exist before (I have already used Knit HTML for many .Rmd reports) but appeared when I used knit2html from the cmd for the first time. The compilation is only working where there are no R code chunks in the .Rmd file or when the chunks are empty. I work under windows 7, R version: 3.2.3, R studio version: 0.99.902. Below is the only R code chunk in the test.Rmd file that I am using for testing:
```{r}
i <- 0
i < i + 3
i
```
推荐答案
看到相同的错误后,以下内容(更新评估包)对我有帮助
After seeing the same error, the following (updating evaluate package) helped me
install.packages("evaluate")
Evaluate由knitr使用.这是有关CRAN的评估链接: https://cran.rstudio.com/web/packages/evaluate/index.html
Evaluate is used by knitr. Here is a link to CRAN about evaluate: https://cran.rstudio.com/web/packages/evaluate/index.html
我的R版本是3.2.4.无需进行任何复杂的重新安装.先尝试一下.
My R version is 3.2.4. There is no need to do any complicated re-installs. Try this first.
这篇关于knitr:将Rmd文件转换为HTML时,R中出现parse_all错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!