VP solution for PA2 for Course R Programming