RMarkdown from UI vs render() omits some contents

I have a complex .Rmd file that creates plots and tables in a loop. It works perfectly fine when knitting from the RStudio UI via the knit button (to html).

In the loop iterations I wrap each ggplot object in a print statement and cat("\n\n") before printing a kable(). This works fine from the UI.

Now I want to call it directly from render() with different arguments. When I call render(), I see the print(kable()) updates the View window in the RStudio IDE but the table does not also appear in the html results. All the other content is fine.

The code chunk has results='asis'.

Sorry but the code is in a secure environment and was hoping someone might give me a pointer before I try to create an example.

TIA!

Self answered. :grin:

Inside the loop print(kable(...)) did not work. Changing this to cat(kable(...)) solved the issue.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.