Assigment R code

comments included