Assignment 2 for the R course