Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

save image of d3heatmap in a file

Tags:

r

d3.js

I am using d3heatmap package in R for to draw heatmaps. When I use it in Rstudio, I can save images that it produces by choosing save image from the viewer menu. I am wondering how I can save the heatmap to a file in an Rscript. Apparently, png(filename) does not work.

like image 228
Amin Avatar asked Aug 19 '15 20:08

Amin


1 Answers

A potential approach is using htmlwidgets and save it in html form only since the d3heatmap returns object of class "d3heatmap" "htmlwidget"

EG.

library(htmlwidgets)
data(mtcars)
map <- d3heatmap(mtcars, scale = "column")
saveWidget(map, "test.html")
like image 108
GAURAV Avatar answered Sep 29 '22 16:09

GAURAV