Hi all,
I can't run R scripts with hydrongen. It seems like if hydrongen can't connect to R kernel. Its runs before make a brew upgrade, however, the R kernel works fine in jupyter notebook .
Here a screen capture of this:

I try to reinstall hydrogen, reinstall IRkernel, upgrade zmq.
So I don't know where is the problem...
Could you take a screenshot of the dev console?
I think the dev console is open in OS X by pressing cmd-opt-i.
Thanks for you help @n-riesco :-).
Yes, here is:

The last two lines report an error launching the R kernel. Could you check whether you're able to run R in the terminal?
Also, could you expand the object in the Kernel spec: line and take a screenshot? I'd like to make sure your kernel spec for R isn't broken.
Of course; yes, I can run R in the terminal:

Maybe can be useful this, r versions installed:

Kernel spect expanded:

What happens when you run R -e IRkernel::main()?
I think what you need is the last input on the picture, but I take picture of all attempts to be sure.

Let's try quoting the argument; could you run R -e 'IRkernel::main()'?
yes, it is the last command with red arrow in the picture.
I think that's the problem. The kernel spec seems broken. You can set up an alternative kernel in the Hydrogen settings. Something like this should work:
{
"kernelspecs": {
"r": {
"spec": {
"display_name": "custom R",
"language": "R",
"argv": ["R", "--slave", "-e", "\"IRkernel::main()\"", "--args", "{connection_file}"],
"env": {}
}
}
}
}
Do you have multiple r versions installed on purpose? If not you could remove the outdated ones with brew cleanup.
The kernelspec is pointing to the old r version. The installation instructions for IRkernel say you have to run:
install.packages(c('repr', 'pbdZMQ', 'devtools')) # repr is already on CRAN
devtools::install_github(c('IRkernel/IRdisplay', 'IRkernel/IRkernel'))
IRkernel::installspec()
Running the last line should update the kernelspecs to match the new r version which hopefully should solve your problem.
With the solution @n-riesco I've gotten it to work.
I tried what you say @lgeiger, but for some reason I do not get install devtools not understand why. How you say, and in a screenshot above, I have 4 versions of R different. After making brew cleanup gives me an error when trying to install devtools, the dependence git2r not available.
Here the error message:
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
‘pbdZMQ-guide.Rnw’
** testing if installed package can be loaded
* DONE (pbdZMQ)
ERROR: dependency ‘git2r’ is not available for package ‘devtools’
* removing ‘/usr/local/lib/R/3.3/site-library/devtools’
The downloaded source packages are in
‘/private/var/folders/cx/7r49499n39z2fw1fq707kym80000gn/T/RtmpOGmfms/downloaded_packages’
Warning messages:
1: In install.packages(c("repr", "pbdZMQ", "devtools")) :
installation of package ‘git2r’ had non-zero exit status
2: In install.packages(c("repr", "pbdZMQ", "devtools")) :
installation of package ‘devtools’ had non-zero exit status
But now I see it, is correct the path to R?
mmngreco:TFG mmngreco$ which r
/usr/local/bin/r
mmngreco:TFG mmngreco$ brew list r
/usr/local/Cellar/r/3.3.1_2/bin/R
/usr/local/Cellar/r/3.3.1_2/bin/Rscript
/usr/local/Cellar/r/3.3.1_2/include/ (9 files)
/usr/local/Cellar/r/3.3.1_2/lib/pkgconfig/libR.pc
/usr/local/Cellar/r/3.3.1_2/lib/ (2 files)
/usr/local/Cellar/r/3.3.1_2/R.framework/Versions/ (2183 files)
/usr/local/Cellar/r/3.3.1_2/R.framework/R
/usr/local/Cellar/r/3.3.1_2/share/man/ (2 files)
However, Hydrogen works again.
Thank you very much for the willingness and support.
Hi all,
I get install devtools again with this code:
install.packages('git2r', type='mac.binary.mavericks')
Today, the the kernel spec get the same issue than yesterday when I try to run R with hydrogen.
So, I removed the kernel spec code passed in settings of Hydrogen and I make Hydrogen:Update Kernels, and get and error but next step, I was select kernel with Hydrogen:Select Kernel, and now runs again.
Thanks for the support. :-)
That's all for me.
Bests,
Ups I totally missed your last comment.
I'm glad you got it working. 🎉
Most helpful comment
Do you have multiple
rversions installed on purpose? If not you could remove the outdated ones withbrew cleanup.The kernelspec is pointing to the old
rversion. The installation instructions forIRkernelsay you have to run:Running the last line should update the kernelspecs to match the new
rversion which hopefully should solve your problem.