R programming assignment