Error in R: Unable to open connection to X11
There are many threads elsewhere related to Cairo package.
One of them mentions the change in X11 type but most of them state that R doesn't know what the display is and suggest doing:
Sys.setenv("DISPLAY"=":0.0")
or, on older systems,
Sys.putenv("DISPLAY"=":0.0")