commented out write.csv() stuff at bottom
r code updated dat file
deleted .csv files (was using to test that the r code was working properly
commented out setwd() at the start, for portability
cleaned up code \n deleted test values for s and f at start of for-loop