Copied all code from R script to RMarkdown file for assignment and added observations