R code for assignment