## Calculate mega environments for TDMaize.
gemegaEnv <- gxeMegaEnv(TD = TDMaize, trait = "yld")
## Calculate new mega environments based on the genotypes with the lowest
## value per environment.
gemegaEnv2 <- gxeMegaEnv(TD = TDMaize, trait = "yld", method = "min")
Run the code above in your browser using DataLab