Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • 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

like image 955
cd98 Avatar asked Dec 04 '25 13:12

cd98


2 Answers

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.

like image 146
daniel Avatar answered Dec 07 '25 07:12

daniel


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.

like image 37
hideaki Avatar answered Dec 07 '25 05:12

hideaki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!