code to plot data in R