Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R studio graph not appearing in plots window

I am having trouble getting my graphs to appear in the 'plots' window of R studio - once I run the script they appear in a separate R graphics window, separate to R Studio, with the 'plots' tab blank.

Is there a setting or code I should use to change this?

Thank you in advance,

like image 631
Sarah Avatar asked Sep 21 '15 05:09

Sarah


People also ask

Why is R not showing my 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 view plots in R?

Please suggest. Menu “View” > “Show Plots”.

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.


1 Answers

This has been a consistent problem for many users ever since the last couple updates, myself included. It was apparently fixed with 3.5 version of R, which I haven't updated to, but you didn't mention which version you are running.

Either way, if you're running the most updated version or not, try getOption("device") and check the output of that. Per an R support community post, if the output does not say RStudioGD, you can use options(device = "RStudioGD").

The NEXT, and more annoying, solution was to uninstall and reinstall RStudio. Many people found that this solved their problem.

If neither of those work work, the only other solution that people were finding is to downgrade your R version to a compatible version unfortunately! It's really annoying, I know!

Hope I could help!

like image 141
Devin Avatar answered Sep 29 '22 13:09

Devin