'saving png/jpeg when X11 is not available

I am using a R package that renders the png images. As I am running the command below in a script, I would like to avoid the error below and still be able to save the images. How shall I do it ?

> ChIPQCreport(SAMPLE, 
+              reportName = paste(ENTRY, "ChIPQC", sep="."), 
+              reportFolder = paste(ENTRY, "ChIPQCreport", sep="."))
Saving 7 x 7 in image
Error in png_dev(..., res = dpi, units = "in") : X11 is not available


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source