Create plot4.R

R code for plot 4.