add ipython notebook and r code of chapter 2