R script - part2