#random population of 200 lines with 1000 markers
#5% missing data
G <- matrix(rep(0,200*1000),200,1000)
for (i in 1:200) {
for (j in 1:1000) {
G[i,j] <- ifelse(runif(1)<0.05,NA,ifelse(runif(1)<0.5,-1,1))
}
}
G.impute <- impute(G,n.neighbor=20)
Run the code above in your browser using DataLab