I'm using the ggdendro package in automated report generation, invoking it as:
tmp <- ggdendro::ggdendrogram(hclust(dists))
for some distance matrix dists.
However, this always seems to open a new graphics device (at least under R 4.4.1 on Linux), which I then need to manually clean up by closing the device, and then deleting the Rplots.pdf file if running on a headless system.
The ggplot2::ggplot() function itself does not have this behaviour; I can assign in a similar way without a new graphics device opening.
If there's something in the documentation for ggdendrogram that will suppress opening a device, I can't find it.