Project solution

R code