I want to dynamically generate tabs, and each tab plot the corddiag
plot
library(igraph)
library(tidygraph)
library(chorddiag)
m <- matrix(c(11975, 5871, 8916, 2868,
1951, 10048, 2060, 6171,
8010, 16145, 8090, 8045,
1013, 990, 940, 6907),
byrow = TRUE,
nrow = 4, ncol = 4)
groupnames <- c("black", "blonde", "brown", "red")
row.names(m) <- groupnames
colnames(m) <- groupnames
m is just some corddiag
plot I use for simplicity.
I have different plots on each page based on a different dataset. So I created a list of corddiag
plots in my next step:
```{r, include=FALSE}
graphList_biling.lan <- list()
for ( i in 1:3) {
graphList_biling.lan[[i]] <- htmltools::tagList(chorddiag(m))
}
```
I just used the same m
in each loop for simplicity, but in my actual plot those will be different, that is why I need to create a list. Then I do the following :
## First learned languages {.tabset .tabset-fade .tabset-pills}
```{r echo=FALSE, fig.height=6, fig.width=6, warning=FALSE, results='asis'}
for (i in 1:3) {
cat("###", paste("Tab ",i), '{-}', '\n\n')
print(htmltools::tagList( graphList_biling.lan[[i]]))
cat( '\n\n')
}
```
Everything works pretty well in Rmarkdown window, but when I knot I can't generate plots. It does create a space but no plots show up