2

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:

  • R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"

  • RStudio Version 0.98.1091

  • Platform: x86_64-apple-darwin13.4.0 (64-bit). Mac OS 10.9.5

  • I installed R with homebrew the following way

    brew tap homebrew/science brew install r

  • Previously I had installed tcl/tk the following way

    brew tap homebrew/dupes brew install tcl-tk --with-tk

cd98
  • 3,442
  • 2
  • 35
  • 51
  • The maintainers of the Mac fork of R don't support homebrew (or MacPorts). There is an Archive of the Mac-SIG-R Mailing list that has the rationale. – IRTFM Dec 31 '14 at 03:10
  • 1
    This might be helpful: https://stat.ethz.ch/pipermail/r-sig-mac/2014-October/011186.html – IRTFM Dec 31 '14 at 03:17
  • Is this the same question in essence? http://stackoverflow.com/questions/18128859/how-can-the-r-location-be-customized-for-rstudio – IRTFM Dec 31 '14 at 04:20
  • @BondedDust, thanks for the links. However, I don't understand the implications. Is it your understanding that right now the homebrew version does not support quartz? That would be an appropriate answer for my question. – cd98 Dec 31 '14 at 11:13
  • @BondedDust, I don't think it's a related question. That person is asking about the search path for RStudio and I don't have any issue with that (I only have one version of R installed right now). – cd98 Dec 31 '14 at 11:15
  • 1
    Please report those issues on the Homebrew/Science tracker where we can usually fix them promptly. The error you're seeing is due to a mistake when packaging the prebuilt binaries. It's being fixed now. – Dominique Jan 04 '15 at 23:49

3 Answers3

5

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.

daniel
  • 66
  • 3
3

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.

hideaki
  • 31
  • 2
  • thanks for your comment. I had R from CRAN before and things were working fine. I did not like installing tcl/tk from the R CRAN package and that's why I tried using the brew version (same reason as you: avoiding conflicts). It would be great if somebody could confirm whether the `brew` version of `R`supports `quartz` or not. – cd98 Jan 01 '15 at 22:28
1

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.

Toph Allen
  • 36
  • 3