I\'ve been struggling with this question for a while. I am only working with PART B and am using R. This is what is written: