R scripts used to run the ***