add scripts for R backend