added function to source R code from github