R code to test the uniformity of samples