For python jupyter notebooks I am currently using VSCode python extension. However I cannot find any way to use alternative kernels. I am interested in jupyter R kernel in particular.
Is there any way to work with jupyter notebooks using R kernel in VSCode?
To see if R installed correctly, open a new notebook in VS Code (open the Command Palette with Cmd-Shift-P, or by clicking on the wheel in the bottom left and selecting Command Palette, then type Jupyter Create New Notebook ). If you don't see a button for R , make sure you followed all the steps above!
If you want to run an entire R file, open the file in the editor, and press Ctrl+Shift+S and the file will be sourced in the active R terminal.
Notebooks in Visual Studio CodeCombined with the Jupyter extension, it offers a full environment for Jupyter development that can be enhanced with additional language extensions. If you want a best-in-class, free Jupyter experience with the ability to leverage your compute of choice, this is a great option.
Yes, it is possible. However, it's not recommended anymore, because it has some bugs. You should use the notebook in VSCode Insiders instead of it in VSCode, since there is support for notebooks of many languages natively.
Anyways, if you want to continue in VSCode, just have to install IRkernel (R kernel) first. According to the docs, run both lines to perform installation:
install.packages('IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
Now, you should 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
Switch to the desired kernel, in this case R's
That's it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With