Now I can use jupyter lab with R kernal in a web browser and use VS Code to edit jupyter note book code with python kernal, is it possible to edit R code in VS Code with jupyter notebook mode? Thanks for the comments and solutions.
Asked
Active
Viewed 2,877 times
8
-
Does this answer your question? [Using jupyter R kernel with visual studio code](https://stackoverflow.com/questions/56497422/using-jupyter-r-kernel-with-visual-studio-code) – catastrophic-failure Sep 01 '22 at 08:51
2 Answers
5
Yes, it is possible. You just have to install IRkernel (R kernel) first.
According to the docs, run both lines
install.packages('IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
Then, restart your VSCode and:
Type Ctrl + Shift + P to search for "Jupyter: Create New Blank Notebook"
Click on the button right below ellipsis in upper right corner to choose kernel
That's it!

testing_22
- 2,340
- 1
- 12
- 28
1
@testing_22 it works with me too
just add some note from my experience
It will failed If you run IRkernel::installspec()
from RStudio or from Jupyter Conda environment
Please run this syntax with VSCode terminal
install.packages('IRkernel')
IRkernel::installspec()
The rest is same, please restart VSCode and select "R" kernel from VSCode

Ichsan
- 768
- 8
- 12