R Scripts from my thesis