[R] Error while working with png output on linux server

Sariya, Sanjeev
2018-02-01T14:50:42Z

I'm working on linux server:
Linux  4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

I get error while creating png files. I'm sharing my commands and error
while I run those commands:

>png("abc", type="cairo")
Error in .External2(C_X11, paste0("png::", filename), g$width,
g$height,  :
  unable to start device PNG
In addition: Warning message:
In png("abc", type = "cairo") : unable to open connection to
X11 display ''

> png("apoeqqplot.png", res=600)
Error in .External2(C_X11, paste0("png::", filename), g$width,
g$height,  :
  unable to start device PNG
In addition: Warning message:
In png("apoeqqplot.png", res = 600) :
  unable to open connection to X11 display ''

dev.off()

R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS: /mnt/mfs/cluster/bin/R-3.4/lib/libRblas.so
LAPACK: /mnt/mfs/cluster/bin/R-3.4/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C
[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] CMplot_3.3.1

loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2


How do I fix this?


	[[alternative HTML version deleted]]