R Code & Plots