could not find function "kable_pipe" / "kable_simple"

Viewed 1601

I am trying to create a table using knitr::kable(head(mtcars[, 1:4]), "simple") knitr::kable(head(mtcars[, 1:4]), "pipe") Although this should work according to https://bookdown.org/yihui/rmarkdown-cookbook/kable.html, it just returns could not find function "kable_pipe".

knitr::kable(head(mtcars[, 1:4]), "html") and knitr::kable(head(mtcars[, 1:4]), "latex")

work perfectly fine.

Does anyone know why?

1 Answers

So I had the same problem as this and figured out the problem is that the default knitr install needs to be updated. I think knitr is installed for Rstudio usage. Maybe it uses an old version?

Anyway solution is to do

install.packages("knitr")

and then restart R. Should work after that.

Related