R programming course. Assignment 2