Homework done for STAT 3013 using R scripts