R Script 2 for Homework #6.