R code backup for Penglais workstation