Saves a pheatmap derived RGenEDA heatmap object to a file in various formats including PNG, JPEG, TIFF, BMP, PDF, and SVG.

GenSave(
  pheatmap_obj,
  filename,
  width = 8,
  height = 6,
  units = "in",
  res = 300,
  ...
)

Arguments

pheatmap_obj

A pheatmap object returned by an RGenEDA or pheatmap function.

filename

Character string specifying the path and filename where the heatmap should be saved.

width

Numeric, the width of the output image. Default is 8.

height

Numeric, the height of the output image. Default is 6.

units

Character, units for width and height when saving raster images. Default is "in".

res

Numeric, the resolution (in dpi) for raster images. Default is 300.

...

Additional arguments passed to the graphics device function.

Value

Invisibly returns the filename of the saved heatmap.

Details

This function is similar in spirit to ggsave() but works specifically with pheatmap objects.

Examples

if (FALSE) { # \dontrun{
library(pheatmap)
mat <- matrix(rnorm(100), 10, 10)
hm <- pheatmap(mat)
GenSave(hm, "heatmap.png")
} # }