why does kable not print when used within a function in rmarkdown
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...
View ArticleAnswer by BradlesP for why does kable not print when used within a function...
I got something similar working by moving the knitr::kable(head(mtcars)) inside a return() at the end of the function.including results = 'asis'e.g.---title: "Markdown example"output:...
View ArticleAnswer by George Savva for why does kable not print when used within a...
You can do this by using print to print the kable output, setting the results="asis" of the code chunk and then using kable_styling from package kableExtra. This works for me:```{r mtcars,...
View ArticleAnswer by PKumar for why does kable not print when used within a function in...
Using a return statement with all objects in a list can help here, You can try recordPlot or plot from base R to solve your problem, By putting each of these plots in list, I managed to get the plots...
View ArticleAnswer by dww for why does kable not print when used within a function in...
The problem seems to be related to knitr::kable incorrectly detecting the environment for the printing when it is embedded inside a function. This interferes with its ability to correctly figure out...
View Article