Moved all R functions to /R