Recompiled R 4.0.3 to not use X11 and to use cairo and now png() works without an X11 error and without a “shadow device graphics error”. Here’s the
configurecommand which I discovered from straychild01’s comment on Setting up your own shiny-server / rstudio-server on a Raspberry Pi 3B+ on the R Studio Community Forum
./configure --with-x=no --with-cairo=yes --with-libpng=yes --enable-R-shlib`
- This also means
xvfb-runis not required to start up RStudio server.