Added R tutorial and changed a few things in chapter 2