1

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.

Community
  • 1
  • 1
imasnake
  • 345
  • 1
  • 3
  • 12
  • 1
    Have you tried to reinstall RStudio? – loki Jul 24 '16 at 19:13
  • 1
    what does `options("device")` give – user20650 Jul 24 '16 at 19:41
  • @user20650 options("device") gives: $device function (title, width, height, pointsize, family, antialias, type, file = NULL, bg, canvas, dpi) { if (missing(type) || type %in% c("", "native", "Cocoa")) { check <- Sys.getenv("_R_CHECK_SCREEN_DEVICE_", "") msg <- "screen devices should not be used in examples etc" if (identical(check, "stop")) stop(msg, domain = NA) else if (identical(check, "warn")) warning(msg, immediate. = TRUE, noBreaks. = TRUE, domain = NA) } – imasnake Jul 24 '16 at 19:53
  • new <- list() if (!missing(title)) new$title <- title if (!missing(width)) new$width <- width if (!missing(height)) new$height <- height if (!missing(pointsize)) new$pointsize <- pointsize if (!missing(family)) new$family <- family if (!missing(antialias)) new$antialias <- antialias if (!missing(bg)) new$bg <- bg if (!missing(canvas)) new$canvas <- canvas – imasnake Jul 24 '16 at 19:55
  • if (!missing(type)) new$type <- type if (!missing(dpi)) new$dpi <- dpi if (!checkIntFormat(new$title)) stop("invalid 'title'") if (!is.null(file) && !checkIntFormat(file)) stop("invalid 'file'") d <- check.options(new, name.opt = ".quartz.Options", envir = .Quartzenv) .External(C_Quartz, d$type, file, d$width, d$height, d$pointsize, d$family, d$antialias, d$title, d$bg, d$canvas, if (is.na(d$dpi)) NULL else d$dpi) invisible() } – imasnake Jul 24 '16 at 19:55
  • Gosh, that's a lot more output than I expected!! Please can you edit your question with the output - hopefully it helps someone to help you. Have you tried `options(device="RStudioGD")` (dont know if this is sensible as a non-mac user) – user20650 Jul 24 '16 at 20:04
  • 1
    @loki, Thanks! Looks like I forgot to also reinstall Rstudio.. :/ – imasnake Jul 24 '16 at 20:06
  • 1
    @user20650 thanks, the problem we me forgetting to reinstall rstudio. Thanks for the suggestion. – imasnake Jul 24 '16 at 20:10
  • Please, [edit] your question with the output of `options("device")` instead of copying it peacewise in comments as suggested by @user20650. This might help user OS users. Thank you. – Uwe Jul 24 '16 at 21:58

2 Answers2

0

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. 
Kayle Sawyer
  • 549
  • 7
  • 22
-1

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

imasnake
  • 345
  • 1
  • 3
  • 12