Adding library files

Moving R files from one repo to the next.