Add figures and R package

Add some initial files for reproducing pictures in manuscript and first
draft of R package.