Linux Mint: Running R in Jupyter Notebook in VS Code
A guide to get the best of Jupyter Notebook in your favorite VS Code

This will guide you how to install required packages to use the R language in the Jupyter Notebook inside Visual Studio Code.
The first thing to get started is to have R installed on your system. If you haven’t installed R on your system then you can refer to official R documentation at official R site. Once, you’ve installed R you can install VS Code for linux.
Now download the Jupyter extension from the VS Code extension. Download the one provided by Microsoft. Restart VS Code after installing it.

Now it’s time to install the IRkernel. You can also follow the documentation available at IRkernel site. Or just simply open a R in terminal and type following command.
install.packages('IRkernel')

Now the kernel spec can be installed for the current user with the following line from R:
IRkernel::installspec()
To install system-wide, set user
to False in the installspec
command:
IRkernel::installspec(user = FALSE)

Now you can start a new Jupyter notebook by pressing CTRL+SHIFT+P
and clicking on Jupyter: Create New Jupyter Notebook
.

Finally, you can do analysis in R just as you do in Python using Jupyter Notebook.
