.R file for Plot 1