Add common R functions
Add common R functions