add R script to calculate predictions