R Scripts from Thesis Work