notebooks for R and Octave
Jupyter notebooks were created for Julia and Python languages. However, they are not restricted to these two languages and by loading the appropriate kernels—there are currently over 100 available—one can execute C, C++, C#, Fortran, Java, R, Julia, Matlab, Octave, Scheme, Processing, Scala, and many more.
Why use Jupyter notebooks?
- Everyone is using them.
- They enable shareable, reproducible research.
- They write the report for you… OK, they faciltate the fusion of text, code and results in a single, publication quality reprot. In particular, they accept LaTeX-type commands for nice math typesetting.
Here, I will show how to install and use the R, Julia and Octave kernels, since Python is already installed by default.
The basic install uses either pip
or conda
as follows:
conda install -c conda-forge notebook
or
pip install notebook
I personally prefer the newer interface,
pip install jupyterlab
Once installed, launch a notebook, that will appear in your default browser, by
jupyter notebook
or
jupyter-lab
R kernel installation and use
- Install R.
- Run R, and execute the commands
install.packages('IRkernel') IRkernel::installspec(user = FALSE)
- In a system command window, launch a notebook and choose the
R
kernel from theNew
dropdown menu.
Octave kernel installation and use
- Install the kernel directly into Jupyter with the command
pip install octave_kernel
- Add the Octave executable to your system path - this is OS-dependent…
- Launch a notebook and choose the
octave
kernel from theNew
dropdown menu.
An example can be found here. Various troubleshooting issues can be found here.
Julia kernel installation and use
- Install Julia
- Run Julia, and execute the following at the command-line:
using Pkg
Pkg.add("IJulia")
- Launch a notebook and choose the
julia
kernel from theNew
dropdown menu.