Figures and R codes for Course Project 2