i need to do the following
for (j in 1:n){
´´´{r}
print(list1[[j]])
´´´
$//$
$//$
$//$
´´´{r}
print(list2[[j]])
´´´
}
That is I need to iterate over code chunks is R markdown.
How can i do that?
i need to do the following
for (j in 1:n){
´´´{r}
print(list1[[j]])
´´´
$//$
$//$
$//$
´´´{r}
print(list2[[j]])
´´´
}
That is I need to iterate over code chunks is R markdown.
How can i do that?
You could use results='asis
chunck option:
---
title: "test"
output: html_document
---
```{r, results='asis', echo = FALSE}
n <- 3
list1 <- lapply(1:n,function(i) LETTERS[i])
list2 <- lapply(1:n,function(i) i)
for (j in 1:n){
cat(list1[[j]],'\n\n')
cat('$//$ \n\n')
cat(list2[[j]],'\n <br> <br> <br>\n')
}
```