How should I share (cite) my datasets and R analysis/code files in my thesis?
First, best compliments for your intent on open and reproducible research! 

Your code and datasets ought to bring you better visibility for your research. GitHub is a good alternative to publish your code. If your datasets involve elements of machine learning you may donate it to the UCI Machine Learning Repository.