We are using a product called GradeScope to grade R code written by students. Gradescope uses something called a "headless server." Apparently, one consequence of this is that code which opens a graphics device (any plotting) dies.
Does anyone understand this enough to suggest a fix or workaround?