R Code for Master course at UPO