Added support for R
run.sh restored (needed for regtests)