cd98
cd98

Reputation: 3532

R version doesn't support quartz graphic device - RStudio won't plot

I'm running Mac OS Maverick.

In my previous setup, the plots would correctly display on the plot tab on RStudio. I reinstalled R with homebrew and, when I use RStudio, it gives me the following warning

WARNING: The version of R you are running against does not support the quartz graphics device (which is required by RStudio for graphics). The Plots tab will be disabled until a version of R that supports quartz is installed.

When I plot something, it opens up the XQuartz app on my mac. It does display the graphs (sometimes with weird colors though), but I'd really like it to plot in RStudio itself.

Is it that homebrew has a version of R that doesn't support the quartz graphics device or have I messed up something elsewhere?

As always, any help will be very much appreciated.


Some details of my setup:

Upvotes: 2

Views: 3727

Answers (3)

Toph Allen
Toph Allen

Reputation: 36

I ran into this problem too. I previously had homebrewed R installation with a working quartz graphic device, which comports with others in this thread who suggest that an update to homebrew's R script caused the problem.

I can confirm that daniel's answer works. I tried brew install r --build-from-source and quartz() has stopped throwing errors.

Upvotes: 1

daniel
daniel

Reputation: 66

I run into the same issue.

According to the R brew formula history the last bottled version (i.e. precompiled version, which is what is installed by default) isn't run against aqua due to some bug so the installation of R has no aqua capabilities, which is what RStudio graphics device requires.

After trying to understand the formula logic I figured that if built from source:

brew install r --build-from-source

it would compile with clang (check brew --env) and therefore correctly build against aqua. It takes a little longer to install but it worked for me. To check, from the terminal open R and see capabilities() aqua should be TRUE for RStudio's graphics device to work.

Upvotes: 5

hideaki
hideaki

Reputation: 31

I'm using homebrewed R and Rstudio on Yosemite. I ran into the same problem, probably after I had updated R from ver. 3.1.2 to ver. 3.1.2_1.

My ad-hoc solution is

  • to brew uninstall R, and
  • to install R from CRAN.

RStudio display graphs inside its window when I use CRAN version of R. However, this is not the best solution to me, because I love to manage all unix packages using homebrew to avoid possible conflicts.

Upvotes: 3

Related Questions