Moving test.R to scripts