Rename the R script to plot1.R and directly write the plot to file.
Ignore some R(studio) files.
Remove variables after the plot has been generated.
A plot for question 2
Code and image for 3rd plot
Code and image for 4th plot
Code and plot for question 5