oslutions for the assignemnt 2 for R programming