I a bit of code that produces a matrix. I then generate a heatmap from this matrix using the function:
heatmap(d)
However, I would like to be able to save this img directly and bypass displaying the graphic, so that I can incorporate this function into a unix-based workflow.
Can someone please show me the snippet of code required to save this image without displaying it on screen? Thanks!
Use jpeg()
, png()
or tiff()
to create the file.
jpeg(file="filename.jpg")
heatmap(d)
dev.off()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With