R programming assignment #2

Assignment #2 for Coursera rprog-006.