You need to install the relevant X11 development library packages on your system, and recompile R so it says TRUE
in the X11 capabilities.
sudo apt-get install libx11-dev libxt-dev
or maybe just the xorg-dev
metapackage:
sudo apt-get install xorg-dev
might be enough. Then run the configure step of the install until it says it has got X11 capabilities. It should output it on screen during the configure step, so you don't need to churn through a compile to find out.
Note that png
support doesn't need a connection to a working X server anymore so anything you read about needing virtual X server process (via xvfb) on headless servers does not apply.