I am encountering an issue when trying to plot anything in RStudio, whether with the basic plot function or with ggplot2.
When I run the code (even for the simplest plot), RStudio seems to get stuck, with the little "stop" sign of the console never disappearing, and crashes after a while.
Let's try to isolate the issue by passing the plot to a variable
plot <- plot(height, weight)
See if it will create the variable.
Also I noticed in the Plots pane that the toolbar buttons are illuminated and clickable, which only happens when there is a plot in the pane. What happens if you select the broom icon to clear the plot variables there?
This time, the toolbar buttons in the Plots pane were not clickable, but in an earlier try they were. When I tried the broom, it said "Clearing..." at the top of RStudio but without finishing the task.
Update ! I seem to have solved the issue, in the Preferences. In the "Graphics" tab from the "General" menu, I switched 'Backend' from (Default) to Cairo, and now it works ! I am so relieved
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: