save heatmap generated by d3heatmap
问题 I'm trying to save a heatmap produced by d3heatmap to a pdf file, but the file is always damaged. library(d3heatmap) pdf(file="heat.pdf") d3heatmap(mtcars, scale = "column", colors = "Spectral") dev.off() I suspect the challenge is "this is an R package that implements a heatmap htmlwidget." However, I figured I could still capture the image produced because "Like any htmlwidget, you can visualize a d3 heatmap directly from the R console." I looked at the two output functions in the package,