Can't render loops in powerpoint with Rmarkdown

Viewed 24

I have in several chunks loops that produce graphs. I want to make a powerpoint presentation out of them, but the loop doesn't work. It only renders the first graph.

Here is a minimal working example:

---
title: "Title"
author: John Doe
date: 
output: 
  powerpoint_presentation
---
knitr::opts_chunk$set(echo = FALSE, warning=FALSE)
n <- 7
for(i in 1:n){plot(c(1:i))}

I have discovered that the knitr::opts_chunk instructions produces the conflict. If there are no knitr/chunk specifications, it does render the loops. The issue is that I need echo = false, because otherwise it renders many code along with the graphs

Does anyone know how could echo = false (or other chunk options) could "coexist" with rendering loops?

I wouldn't mind rendering it on html but it gaves me other issues as well, similar to this (with tabset)

EDIT: I wasn't clear in the last sentence. If rendered to html, the loops work just fine, but in that case I would need each graph of the loop to be in a different tab, and I have no clue how to do that. Also, powerpoint makes it easier for me for further formatting.

Best regards.

0 Answers
Related