Produces genotype plus genotype-by-environment model based on a multi-environment trial dataset containing at least the columns for genotypes, environments and one response variable or a two-way table.
gge(
.data,
env,
gen,
resp,
centering = "environment",
scaling = "none",
svp = "environment",
by = NULL,
...
)
The dataset containing the columns related to Environments, Genotypes and the response variable(s).
The name of the column that contains the levels of the environments.
The name of the column that contains the levels of the genotypes.
The response variable(s). To analyze multiple variables in a
single procedure a vector of variables may be used. For example resp = c(var1, var2, var3)
. Select helpers are also supported.
The centering method. Must be one of the 'none | 0'
, for no
centering; 'global | 1'
, for global centered (E+G+GE); 'environment | 2'
(default),
for environment-centered (G+GE); or 'double | 3'
, for double centered (GE).
A biplot cannot be produced with models produced without centering.
The scaling method. Must be one of the 'none | 0'
(default), for no scaling;
or 'sd | 1'
, where each value is divided by the standard deviation of its corresponding
environment (column). This will put all environments roughly he same rang of values.
The method for singular value partitioning. Must be one of the 'genotype | 1'
,
(The singular value is entirely partitioned into the genotype eigenvectors, also called row
metric preserving); 'environment | 2'
, default, (The singular value is entirely partitioned into the
environment eigenvectors, also called column metric preserving); or 'symmetrical | 3'
(The singular value is symmetrically partitioned into the genotype and the environment eigenvectors
This SVP is most often used in AMMI analysis and other biplot analysis, but it is not ideal for
visualizing either the relationship among genotypes or that among the environments).
One variable (factor) to compute the function by. It is a shortcut
to dplyr::group_by()
.This is especially useful, for example,
when the researcher want to produce GGE biplots for each level of a
categorical variable. In this case, an object of class gge_grouped is
returned.
Arguments passed to the function
impute_missing_val()
for imputation of missing values in case
of unbalanced data.
The function returns a list of class gge
containing the following objects
coordgen The coordinates for genotypes for all components.
coordenv The coordinates for environments for all components.
eigenvalues The vector of eigenvalues.
totalvar The overall variance.
labelgen The name of the genotypes.
labelenv The names of the environments.
labelaxes The axes labels.
ge_mat The data used to produce the model (scaled and centered).
centering The centering method.
scaling The scaling method.
svp The singular value partitioning method.
d The factor used to generate in which the ranges of genotypes and environments are comparable when singular value partitioning is set to 'genotype' or 'environment'.
grand_mean The grand mean of the trial.
mean_gen A vector with the means of the genotypes.
mean_env A vector with the means of the environments.
scale_var The scaling vector when the scaling method is 'sd'
.
Yan, W., and M.S. Kang. 2003. GGE biplot analysis: a graphical tool for breeders, geneticists, and agronomists. CRC Press.
# NOT RUN {
library(metan)
mod <- gge(data_ge, ENV, GEN, GY)
plot(mod)
# GGE model for all numeric variables
mod2 <- gge(data_ge2, ENV, GEN, resp = everything())
plot(mod2, var = "ED")
# If we have a two-way table with the mean values for
# genotypes and environments
table <- make_mat(data_ge, GEN, ENV, GY) %>% round(2)
table
make_long(table) %>%
gge(ENV, GEN, Y) %>%
plot()
# }
Run the code above in your browser using DataLab