Create rft.r

This is Jack's initial R code without dopar implemented