R Programming - 2nd assignment