Thanks @ismirsehregal. You're absolutely right that DataExplorer::plot_str() can be tricky to use inside a Shiny app
plot_str() does not return a ggplot — it returns a nested list structure that is automatically rendered using networkD3::diagonalNetwork().
This behavior works in interactive RStudio, but fails when knitting to R Markdown (especially with custom HTML output formats or when used with renderPlot() in Shiny.
I encountered the same issue when knitting R Markdown documents using rmdformats::readthedown. The default plot_str(df) call does not render properly in the knitted HTML.
The fix is the same: pass the list to networkD3::diagonalNetwork() manually
```{r, echo=FALSE}
library(DataExplorer)
library(networkD3)
df <- mtcars # Your dataset here
# Pass ‘plot_str’ output to diagonalNetwork
diagonalNetwork(plot_str(df))
```