R code to use walk trap algo for GM