DT = DT_big
M = apply(M_big,2,as.numeric)
rownames(M) <- rownames(M_big)
# unbalance the data intentionally to mimic a real scenario with missing records
nas <- sample(1:nrow(DT), round(nrow(DT)*.2))
DTu <- droplevels(DT[setdiff(1:nrow(DT), nas),])
# balance your data to be able to use the eigen decomposition
DTb <- balanceData(data=DTu, slope = "id", intercept = c("envf","repf"))
DTb$value <- imputev(x=DTb$value, by=DTb$env)
# now this dataset can be used with the argument 'rotation=TRUE' in lmebreed
Run the code above in your browser using DataLab