4

I am attempting to compile a knitr MWE using the knitrBootstrap package. I am using the Ctrl+Shift+K shortcut key in RStudio, which essentially calls the knit function from knitr.

Here is the MWE I am trying to compile, which is basically the MWE given on Jim Hester's knitrBootstrap page here:

---
author: "FG"
date: "Tuesday, April 29, 2014"
output:
  knitrBootstrap::bootstrap_document:
    title: "Test LaTeX"
    theme: journal
    highlight: visual studio
    theme.chooser: TRUE
    highlight.chooser: TRUE
---

```{r}
x = a + b
```

$$ 
\begin{align}
x^2 + \mathbf{y}^2
\end{align}
$$

However, this gives me the

Error: 'bootstrap_document' is not an exported object from 'namespace:knitrBootstrap' Execution halted

That bootstrap_document is not a function exported from the namespace of knitrBootstrap is easy to verify. Has something changed since the page on Jim Hester's blog was written?

tchakravarty
  • 10,736
  • 12
  • 72
  • 116
  • bootstrap_document *is* a function exported by the knitrBootstrap package (line 4 of the NAMESPACE file). So you've broken something... – Spacedman Apr 29 '14 at 17:06
  • 1
    @Spacedman Nope. Here's a better deduction -- most people get packages from [CRAN](http://cran.r-project.org/web/packages/knitrBootstrap/index.html) (if available). Anyway, thanks for that, getting the package from github works. – tchakravarty Apr 29 '14 at 17:14
  • That's not what the instructions on that page say. Looks like you need version from github. – Spacedman Apr 29 '14 at 17:14
  • 2
    Yes as you have discovered you need the version from github in order to use the knitrBootstrap package with rmarkdown. I can't put the latest version on CRAN until the rmarkdown package is also released on CRAN, sorry! – Jim Apr 29 '14 at 17:16
  • @Jim Thanks much. `knitrBootstrap` looks like a great package -- look forward to using it. – tchakravarty Apr 29 '14 at 17:17
  • @Jim Quick followup question. Can I include the `fragment_only` option of `markdownToHTML` as YAML front matter? I tried and the `render` function complained. I am basically trying to produce output that I can plug into my blog. – tchakravarty Apr 30 '14 at 13:52
  • `markdownToHTML` and the `fragment_only` option are in the `markdown` package, not the `rmarkdown` package that knitrBootstrap uses now. There is probably a way to do what you are attempting, but the explanation is not going to fit in a comment, make a new question (with a reproducible example) and I will try to answer it. – Jim May 01 '14 at 16:19
  • @Jim I was going to do just that. Will leave a note here for you when I do. – tchakravarty May 01 '14 at 17:07

0 Answers0