R programming second programming assignment