'Unable to get plots displayed in Rstudio graphical viewer.

When I run my code all my graphs (both ggplot2 and plot) are displayed in an external "Quartz 2 [*]" graphical viewer.

I would like them to be displayed in the R studio GUI plot area to I can better save and view my files, along with the previous versions.

Is there anyway to stop this?

I recently updated my version of R, along with the X11 and xQuartz on my mac (also up to date), and I am guessing these updates are behind it.

I have seen many forums explaining how to get rstudio to export to an external viewer (e.g. "quartz()"), but not the other way.

I have looked, but these threads have not helped:

dev.off() even when hidden hide <- dev.off() is not working either.

Any help would be great, Thanks.



Solution 1:[1]

If you upgrade R without upgrading RStudio, the graphics engine may not be compatible. To fix the "Quartz 2" popout, upgrade RStudio to a newer version that supports the graphics engine in the version of R you have installed.

I had the same problem, and noticed the following output to the console:

Warning message:
R graphics engine version 15 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed. 

Solution 2:[2]

Looks like I forgot to reinstall Rstudio as well.. That sorted my problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kayle Sawyer
Solution 2 imasnake