R Code for the master course at UPO