1

I can't figure out how to configure my setting to get R to work in Beaker? I tried both with the experimental beaker-notebook-1.5.3-0-gb1553d1-electron-mac.dmg version because I really don't want to use the browser for my programming. I also tried the normal beaker-notebook-1.5.2-0-g34d512f-mac.dmg but got the same issue when running R.

Checked where my R is located

$ which R
/usr/bin/R

Checked which version of R i'm using

$ R

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

My preferences .json file

#~/.beaker/v1/config/beaker.pref.json
{
  "languages" : {
    "IPython" : {
      "path" : "/Users/Mu/anaconda/bin"
    },
    "Python3" : {
      "path" : "/Users/Mu/anaconda/envs/python3/bin"
    }
    "R" : {
      "path" : "/usr/bin"
    }
  },
  "pref-format" : "1",
  "advanced-mode" : false,
  "allow-anonymous-usage-tracking" : true
}

enter image description here

IPython is working fine...

enter image description here

Community
  • 1
  • 1
O.rka
  • 29,847
  • 68
  • 194
  • 309
  • `install.packages('Rserve')`? you should also install the other packages listed [here](http://beakernotebook.com/getting-started?osx&scroll) – rawr Apr 14 '16 at 04:12
  • Yea :( I installed all of those manually and it still didn't work. – O.rka Apr 14 '16 at 05:28

2 Answers2

1

How did you install R? For me R works and it's in /usr/local/bin/R -- I installed from r-project.org. But really it should work with R anywhere in your PATH.

Possibly the way Beaker is running R it is starting with a library path different from where you installed them?

If the problem persists please file an issue on github https://github.com/twosigma/beaker-notebook/issues

Thanks.

--

addendum: sounds like some people need to install the dependencies with the cmd line and some with R studio. would love to hear from an R expert how to make this consistent.

spot
  • 108
  • 7
  • Hey thanks for checking it out, I don't think it's looking for a different R since I specified the path in the json file along with the python paths. Both are working (py2 and py3) but R isn't – O.rka Apr 15 '16 at 01:44
  • So essentially I had to install all of those through RStudio, not in the terminal for some reason – O.rka Apr 15 '16 at 19:48
0

I was facing the same issue this morning. R backend failed while IPython was running fine, only difference was me being on a Windows machine. I tried everything given here and on other answers. i.e. Installing all dependencies via CMD and RStudio, tried different paths, tried updating R, tried different library paths in R

Solution:

  1. Go to Anaconda folder

  2. Install R and activate it Link

  3. Check if it works. Possibly it doesn't plot, which you can check by

    hist(rnorm(100))

  4. Error you receive maybe

Error in png(tf, width, height, "in", pointsize, bg, res, type = "cairo", : unable to load winCairo.dll: was it built?

Error in jpeg(tf, width, height, "in", pointsize, quality, bg, res, type = "cairo", : unable to load winCairo.dll: was it built?

  1. Check which version of R was installed in Conda

    R.version

  2. Download and install that particular R version from Cran website

  3. Copy the file winCairo.dll

FROM /YourPath/R/library/grDevices/libs/x64/winCairo.dll TO /YourPath/Anaconda/R/library/grDevices/libs/x64/winCairo.dll

  1. Then add this 'options(jupyter.plot_mimetypes = 'image/png')' in your R notebook
  2. Go to step 3 and check
  3. Now go to beaker.pref.json and add the path

/YourPath/Anaconda/R

And that should solve the issues. This maybe a workaround but it worked for me.

Community
  • 1
  • 1