R codes scripted for plotting the graphs

4 separate R codes
Plots