R script to automate generation of SDM files