A R code for data simulation