Il me manque quelque chose de très simple, alors j'espère que ce sera une solution facile.Incorporation d'une liste de graphiques dans un rapport html Rmarkdown
Je produis une liste de heatmaps plotly
dans un bloc de code Rmarkdown
et je veux ensuite les intégrer dans le rapport à l'étape suivante, en boucle.
Je suis en train:
---
title: "test"
output: html_document
---
```{r setup, include=FALSE,echo=FALSE}
knitr::opts_chunk$set(echo=FALSE,out.width='1000px',dpi=200,fig.keep="all")
options(width = 1000)
options(knitr.table.format = "html")
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(plotly))
suppressPackageStartupMessages(library(knitr))
```
```{r heatmaps, include=FALSE,echo=FALSE}
set.seed(1)
heatmaps.list <- vector(mode="list",3)
for (i in 1:3) heatmaps.list[[i]] <- plot_ly(z = matrix(rnorm(10000),100,100), type = "heatmap")
```
```{r plots, include=FALSE,echo=FALSE}
for (i in 1:3){
heatmaps.list[[i]]
cat("\n")
}
```
Malheureusement, ce n'est pas noyant les heatmaps bien qu'ils soient produits dans le bloc de code heatmaps
Rmarkdown
.
Si j'essayer avec base
intrigue est semble fonctionner:
```{r heatmaps, include=FALSE,echo=FALSE}
set.seed(1)
hist.list <- vector(mode="list",3)
for (i in 1:3){
hist.list[[i]] <- hist(rnorm(10000),plot=F)
}
```
```{r plot, warning=FALSE,message=FALSE,echo=FALSE}
for (i in 1:3){
plot(hist.list[[i]])
cat("\n")
}
```