Create a resample.R to check Javascript calcs