Useful R code for the Estimation of Migration