-1

I keep getting this Error whilst using Rmarkdown everytime i Knit. 'opts_hooks' is not an exported object from 'namespace:knitr'

'opts_hooks' is not an exported object from 'namespace:knitr'

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
  • I am completely new to Rmarkdown, where am I suppose to type that? – Ameer Adam Jul 25 '16 at 22:44
  • Some more context is needed here; please post the code you are working with. – Will Jul 25 '16 at 22:48
  • what do you mean? the entire document? – Ameer Adam Jul 25 '16 at 22:49
  • Welcome to Stack Overflow! Can you please include data and/or code that will provide us with a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) ? In this case, an example of a **minimal** document that fails for you would be helpful. Also, results of `sessionInfo()` and possibly `packageVersion("knitr")` ... – Ben Bolker Jul 25 '16 at 22:51
  • this does [seem to come up reasonably frequently](https://www.google.ca/search?client=ubuntu&channel=fs&q=opts_hooks+is+not+an+exported+object&ie=utf-8&oe=utf-8&gfe_rd=cr&ei=LJiWV6-mHMiC8QejzaHQCA#channel=fs&q=%22opts_hooks+is+not+an+exported+object%22), but none of the links provides an obvious answer (I'm betting on an old `knitr` version ...) – Ben Bolker Jul 25 '16 at 22:54
  • r version 3.1.2, knitr 1.8 – Ameer Adam Jul 25 '16 at 22:56
  • Even the default Rmarkdown document wont run - comes up with the exact same error – Ameer Adam Jul 25 '16 at 22:57
  • @BenBolker R version 3.1.2, Kntr 1.8.. Even the default Rmarkdown document wont knit - comes up with the exact same error (the document that comes up as a default when you open a new Markdown file). – Ameer Adam Jul 25 '16 at 23:02
  • @ZheyuanLi thanks man will keep that in mind – Ameer Adam Jul 25 '16 at 23:02
  • current version of `knitr` is 1.13. Update or re-install ... – Ben Bolker Jul 25 '16 at 23:09
  • @BenBolker How do i do that? – Ameer Adam Jul 25 '16 at 23:11
  • Welcome to Stack Overflow! I edited your question as far as I could guess your problem. However, add code and description so that more people with knowledge of the subject will see it. Please edit in the specific error-message you're encountering in case that's necessary to identify the specific problem. Good Luck! – Enamul Hassan Jul 26 '16 at 02:02

1 Answers1

2

The current version of knitr on CRAN is 1.13. According to the archive version 1.9 (obsoleting 1.8) was released in early 2013; 3.5 years is a long time in R-package-land, especially for rapidly developing packages. update.packages() or install.packages("knitr") ... or in RStudio go to the package management pane and click the equivalent buttons.

R 3.1.2 is also pretty old, you may run into dependency problems. I'm going to guess that you may be running Linux; the stable repositories tend to have quite old versions of R. Go to CRAN and follow the links for your operating system to update ...

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453