Part 1

R script for part 1 1 through 6