adding my R programs for generating the four requested graphs