R scripts for Genesys