Programming assignment for R programming course