Quantcast
Channel: why does kable not print when used within a function in rmarkdown - Stack Overflow
Viewing all articles
Browse latest Browse all 5

why does kable not print when used within a function in rmarkdown

$
0
0

I have to repeat certain outputs in many rmarkdown reports and want to write a function to use for this.

Calling a function outputs plots ok when I knit the rmd file but not kable data frames.

For example

---title: "Markdown example"output: html_document---```{r setup, include=FALSE}knitr::opts_chunk$set(echo = TRUE)```# Markdown example```{r mtcars}make_outputs <- function(){  knitr::kable(head(mtcars))  plot(mtcars$mpg, mtcars$cyl)  hist(mtcars$cyl)}make_outputs()```

Displays the plots but not the kable table.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images