Code for programming asignment 2 - R Programming Course