Reputation: 101
I am on Windows 10. I have installed R-3.2.0, Anaconda 2.2.0 64 bit, RStudio-0.99.446. Also, edited system path variable to include R installation directory.
I am following all the instruction given in https://github.com/IRkernel/IRkernel but I am not getting R kernel when I open Ipython notebook.
Can anybody tell what am I missing?
Upvotes: 3
Views: 2489
Reputation: 1341
Those who haven't installed it yet can follow these instructions:
Visit this LinkedIn post if you want to read the instructions in spanish.
1) Create your R virtual enviroment
Skip this step if you have it already. If you don't know how to create it, visit this page.
2) Get your R executable path
This step is to make sure you to use the proper instalation of R through the next steps and with that, avoid reference/path errors later. There are several ways to get the path, the one I propose is the following:
2.1 Run Anaconda prompt as administrator. If you don't know how to do it visit this page.
2.2 In Anaconda Prompt, active your R virtual enviroment using the command activate {my enviroment's name}
(notice that, in my case, I named my R virtual enviroment as 'RStudio'):
R.home()
In my case:
3) Quit R session, and then, deactivate your virtual enviroment
You can use the method q()
to quit R. For deactivating your virtual enviroment use the command: conda deactivate
4) Run R from your base enviroment
Go to the path you copied in Step 2. For that, use the command:
cd {your path here}
Once there, type R.exe and press Enter.
e.g.
If you got no errors here, go to Step 5.
If you got a dynamic link library error like this when trying to run R.exe:
Use the following command:
conda install -c r r
Once solved, run R.exe again and then, continue to Step 5
5) Installing R kernel stuff
Now, you're in Anaconda Prompt as Administrator, with your R session opened from the base enviroment, the next you must do is:
install.packages("devtools")
5.2 Install RTools. Follow the steps explained here.
5.3 Install IRkernel. Follow the steps explained here.
Now, your R kernel is set and ready to go!
Upvotes: 0
Reputation: 29
Once IRkernel
is installed, you can also simply issue the following command in R:
IRkernel::installspec(user = FALSE)
The kernel.json
file should be automatically created in the appropriate folder ("C:\ProgramData\jupyter\kernels\ir"), along with a nice R logo
Upvotes: 2
Reputation: 101
Got it working, after following all the process mentioned in IRkernel GitHub page. Create kernel.json file in C:\Users\[username]\.ipython\kernels\R_kernel, content of the file should be
{"argv": ["C:/Program Files/R/R-3.2.0/bin/R.exe","-e","IRkernel::main()",
"--args","{connection_file}"],
"display_name":"R"
}
Note that instead of forward slash path should contain backward slash as mentioned above.
Upvotes: 2