19
votes

I am getting below Parsing error each time I use Knit Html in R for converting my Rmd files into HTML:

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

Execution halted

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
```
3
there is a nearly identical (but now deleted, so invisible to low-rep users) question at stackoverflow.com/questions/37239317/… ... I wonder if some piece of infrastructure is (probably temporarily) broken?Ben Bolker
aargh I have the same. It started when I updated the knitr package. If only I had read your question before... Is there a way to revert the updates?Vincent
My guess is your version of the evaluate package is too old. Please see FAQ1: github.com/yihui/knitr/blob/master/FAQ.mdYihui Xie
Had the same issue, and it fixed it by updating the evaluate package.eflores89
Same for me, upgraded evaluate from version 0.8 to version 0.9 and the problem went away.Nicholas Hamilton

3 Answers

17
votes

After seeing the same error, the following (updating evaluate package) helped me

install.packages("evaluate")

Evaluate is used by knitr. Here is a link to CRAN about evaluate: https://cran.rstudio.com/web/packages/evaluate/index.html

My R version is 3.2.4. There is no need to do any complicated re-installs. Try this first.

16
votes

Yes, Vincent is right. You seem to have updated your knitr package to version 1.13 in the last days. This version only runs under the new R version 3.3.0 (also released a couple days ago).

You have two options:

  1. Update R to version 3.3.0
  2. Revert your knitr installation to version 1.12 using the following code:

    packageurl <- "http://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.12.tar.gz"
    install.packages(packageurl, repos=NULL, type="source")
    
0
votes

I faced with the same exact problem, hence I came up with this page. Based on the suggestions, I installed R version 3.3.0, and uninstalled 3.2.4. I re-installed the packages. However, fread function stopped working. I read that it might be related to dll's being messed up etc. Then I completely uninstalled R, and Rstudio. I also deleted the library folder where the packages are installed. Re-installed R, then Rstudio (latest version 0.99.902), then the packages. Now everything is working fine.