R programming - programming assignment 2.