R script integration