Modify plot1 and plot2.R to use plyr library