ge_eff: The genotype-environment interaction effect.
res_eff: The residual effect. The effect is sampled from a normal distribution with zero mean and standard deviation equal to res_eff. Be sure to change res_eff when changin the intercept scale.
intercept: The intercept.
seed: The seed.
Returns
A data frame with the simulated traits
Details
The functions simulate genotype or genotype-environment data given a desired number of genotypes, environments and effects. All effects are sampled from an uniform distribution. For example, given 10 genotypes, and gen_eff = 30, the genotype effects will be sampled as runif(10, min = -30, max = 30). Use the argument seed to ensure reproducibility. If more than one trait is used (nvars > 1), the effects and seed can be passed as a numeric vector. Single numeric values will be recycled with a warning when more than one trait is used.
Examples
library(metan)# Genotype data (5 genotypes and 3 replicates)gen_data <- g_simula(ngen =5, nrep =3, seed =1)gen_data
inspect(gen_data, plot =TRUE)aov(V1 ~ GEN + REP, data = gen_data)%>% anova()# Genotype-environment data# 5 genotypes, 3 environments, 4 replicates and 2 traitsdf <-ge_simula(ngen =5, nenv =3, nrep =4, nvars =2, seed =1)ge_plot(df, ENV, GEN, V1)aov(V1 ~ ENV*GEN + ENV/REP, data = df)%>% anova()# Change genotype effect (trait 1 with fewer differences among genotypes)# Define different intercepts for the two traitsdf2 <-ge_simula(ngen =10, nenv =3, nrep =4, nvars =2, gen_eff = c(1,50), intercept = c(80,1500), seed =1)ge_plot(df2, ENV, GEN, V2)