add R script for data processing