metan (version 1.2.1)

gge: Genotype plus genotype-by-environment model

Description

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.

Usage

gge(
  .data,
  env,
  gen,
  resp,
  centering = "environment",
  scaling = "none",
  svp = "environment"
)

Arguments

.data

The dataset containing the columns related to Environments, Genotypes and the response variable(s). It is also possible to use a two-way table with genotypes in lines and environments in columns as input. In this case you must use table = TRUE.

env

The name of the column that contains the levels of the environments.

gen

The name of the column that contains the levels of the genotypes.

resp

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.

centering

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 centred (GE). A biplot cannot be produced with models produced without centering.

scaling

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.

svp

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).

Value

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'.

References

Yan, W., and M.S. Kang. 2003. GGE biplot analysis: a graphical tool for breeders, geneticists, and agronomists. CRC Press.

Examples

Run this code
# 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)

# If we have a two-way table with the mean values for
# genotypes and environments

table <- make_mat(data_ge, GEN, ENV, GY)
table
make_long(table) %>%
gge(ENV, GEN, Y) %>%
plot()
# }

Run the code above in your browser using DataLab