The R code has been updated for the assignment.

Assignment two update.