## Set seed for reproductibility
set.seed(123)
## Load "wheat" dataset from BGLR
data("wheat",package = "BGLR")
## Generate a design data frame for all genotypes in 5 environments
Design <- expand.grid(Genotype=rownames(wheat.A),Environment=paste0("Env",1:5))
## Set sparseness by discarding 75% of the combinations
Design <- Design[-sample(nrow(Design),round(nrow(Design)*3/4)),]
## Simulate phenotypic data with default parameter values
DataSim <- Simulate_MET_data(Design=Design,K=wheat.A)
## Generate the phenotypic response matrix for BGLR and the corresponding kinship matrix
BGLR_data <- BGLR_format(Pheno=DataSim$Pheno,K=wheat.A)
head(BGLR_data$BGLR_pheno)
Run the code above in your browser using DataLab