4

I have a Rmd file that uses some of the saved Rdata in the working directory and displays them, pretty simple. I even have cache=FALSE. When I click the kintHTML button, I get the html page. When I go to the Rstudio console and type knit('TestReport.Rmd'), I get the error

Error in evaluate(code, envir = env, new_device = FALSE, stop_on_error = opts_knit$get("stop_on_error")) : unused argument(s) (new_device = FALSE, stop_on_error = opts_knit$get("stop_on_error"))

What could be wrong? I have installed evaluate package as well.

mnel
  • 113,303
  • 27
  • 265
  • 254
  • 1
    Have you updated `knitr` or `evaluate` recently? Perhaps you should do so. – mnel Jan 10 '13 at 05:23
  • 2
    stop_on_error` is new for evaulate 0.4.3. Perhaps the versions being accessed by `knitHTML` and from the `Rstudio` prompt are not the same. – mnel Jan 10 '13 at 05:29

1 Answers1

2

Please see knitr FAQ #1. In this case you have to update the evaluate package at least. It is weird somehow because I have specified the version of evaluate must be greater than 0.4.2 in DESCRIPTION, and I do not know why R did not install the correct version when you installed knitr.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • not sure if this is related, but (as mentioned [here](https://github.com/yihui/knitr/issues/458)): For some reason, `update.packages("evaluate")` did not upgrade to 0.4.3, although `devtools::install_version("evaluate", "0.4.3")` did. – David LeBauer Jan 11 '13 at 20:13
  • @David because the first argument of `update.packages()` is `lib.loc` (library location), and `evaluate` is not a library location; it is a package name. You should run `update.packages()` instead. See `?update.packages` for details. – Yihui Xie Jan 11 '13 at 21:44
  • @sindhumaiyya That is hard to believe. Please show `sessionInfo()` after you `library(knitr)`. – Yihui Xie Jan 15 '13 at 16:27
  • @Yihui Thanks for the help, I used run R in a server with many users. I updated evaluate as root user, and knit command is working now. I had installed knitr package just a week back and by default evaluate 0.4.3 didn't get installed as one of the dependencies. May be you can look into that. Thanks a lot! – sindhu maiyya Jan 17 '13 at 04:25
  • @sindhumaiyya Thanks for the feedback. Now I have released knitr 1.0 to CRAN, which specified `evaluate >= 0.4.3`, and I think `update.packages()` should be able to figure out the right version now. You have multiple library locations (`.libPaths()`), and it sounds like `knitr` or `evaluate` was installed in multiple locations. – Yihui Xie Jan 17 '13 at 04:45