Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display graphics in plots window pane rather than opening new window in RStudio

I googled this to no avail. I must have unknowingly changed some setting because now when I print a plot or histogram rather than displaying the plot in the plots window, a new window opens with the plot. The title of the new window reads "R Graphics: Device 2 (ACTIVE)".

like image 492
snarble Avatar asked May 16 '16 16:05

snarble


People also ask

Why is RStudio not showing plots?

Go to Tools->Global Options->Rmarkdown. In "Show output preview in" select "Viewer Pane" Uncheck the box "Show output inline for all R Markdown documents"

How do I add a new window in R?

There are two ways to open a new source window: Pop out an editor: click the Show in New Window button in any source editor tab. Tear off a pane: drag a tab out of the main window and onto the desktop; a new source window will be opened where you dropped the tab.

What does Dev OFF () do in R?

dev. off shuts down the specified (by default the current) device. If the current device is shut down and any other devices are open, the next open device is made current.


2 Answers

It is a problem that appeared with R 3.3.0 for some RStudio versions. You can check your version with version in RStudio. It should work with a RSudio 0.99.902.

For more details, check here.

like image 69
sjakw Avatar answered Oct 08 '22 21:10

sjakw


Some code you ran probably pushed a new graphics device onto the stack. You can turn it off with:

> dev.off()

See the R documentation for managing output devices.

like image 39
Jonathan Avatar answered Oct 08 '22 21:10

Jonathan