R programming assignment

Amended