I’m running R as another user on my system (sudo -uTest R), and certain commands (e.g. plot) fail with ‘unable to open connection to X11 display’. This works fine running R normally, so I know it has to do with running as someone else. I’m guessing this happens because Test doesn’t have the desktop/display/whatever running under their name so there’s nowhere to draw the graph.
Is there anything I can do about this?
In a terminal window, type: