Main code is a function too

All functions: RRegrs/R/RRegrs_Functions.R
Test of functions: Rscripts/RunRRegrs.R