Completing the R functions