added permutationtest R code