added R files (functions and tutorial)