R script for assignement