Jupyter lets you create interactive documents containing text and code + output
Many languages are supported, including Julia, Python and R
Good tool for (a) documenting an analysis in one file (b) interactive R use
The main interface is the "Jupyter notebook" - a web app that runs in the browser
Jupyter is an open source project written in Python
It's a spin-off of "IPython" - similar project for notebooks containing Python code only
R support is quite new so not a lot of documentation yet!
Notebooks are stored as JSON objects
These contain full details of current session
So you can immediately view someone's analysis by opening a file
And then modify and rereun parts if you choose
Below I list some things that a Jupyter notebook can display
Input can be plain text
Or markdown, allowing for easy formatting features
e.g.
$\int_{-\infty}^\infty e^{-\theta^2} \sin \theta\ d\theta$ 3. Lists! 4. Hyperlinks 5. Raw HTML:
Explanatory text can be mixed with code.
Let's estimate $\int_0^1 x^3 dx$ by Monte Carlo integration (correct answer is 0.25)
i.e. I'll simulate uniform random points in the unit square and find the proportion below the graph of $x^3$
n = 1000; x = runif(n, 0, 1); y = runif(n, 0, 1)
mean(y < x^3)
xx = seq(0,1,length.out=100)
plot(x,y, col=1 + (y<x^3), pch=16) + lines(xx, xx^3, col="blue", lwd=3)
The first screen you see is the dashboard
Here you can load a notebook from the file system
Or create a new notebook: File
-> New Notebook
-> R
More details are in the Jupyter basics documentation
Notebooks can be viewed through a browser without installing any software locally
Using nbviewer
Notebooks on github are automatically displayed using this
Also a multi-user Jupyter server exists, jupyterhub
nbconvert
reveal.js
(aka features I don't understand yet!)
knitr
better for automatic report generationThese slides are at https://github.com/dennisprangle/R-North-East-Talk-2016