R scripts implementing predictive algorithms