Learn R Programming

metan (version 1.7.0)

plot.gge: Create GGE biplots

Description

Produces a ggplot2-based GGE biplot based on a model of class gge. Since the output is an object of class ggplot, all stylistic attributes of the output can be customized using the power of plot customization provided by ggplot2.

Usage

# S3 method for gge
plot(
  x,
  var = 1,
  type = 1,
  sel_env = NA,
  sel_gen = NA,
  sel_gen1 = NA,
  sel_gen2 = NA,
  shape.gen = 21,
  shape.env = 23,
  size.shape = 2.2,
  size.shape.win = 3.2,
  size.bor.tick = 0.3,
  col.gen = "blue",
  col.env = "forestgreen",
  col.alpha = 1,
  col.circle = "gray",
  col.alpha.circle = 0.5,
  leg.lab = c("Gen", "Env"),
  size.text.gen = 4,
  size.text.env = 4,
  size.text.lab = 12,
  size.line = 0.8,
  large_label = 4.5,
  axis_expand = 1.2,
  title = TRUE,
  plot_theme = theme_metan(),
  ...
)

Arguments

x

An object of class gge

var

The variable to plot. Defaults to var = 1 the first variable of x.

type

The type of biplot to produce.

  1. Basic biplot.

  2. Mean performance vs. stability.

  3. Which-won-where.

  4. Discriminativeness vs. representativeness.

  5. Examine an environment.

  6. Ranking environments.

  7. Examine a genotype.

  8. Ranking genotypes.

  9. Compare two genotypes.

  10. Relationship among environments

sel_env, sel_gen

The name of the environment and genotype to examine when type = 5 and type = 7, respectively. Must be a string which matches a environment or genotype label.

sel_gen1, sel_gen2

The name of genotypes to compare between when type = 9. Must be a string present in the genotype's name.

shape.gen, shape.env

The shape for genotype and environment indication in the biplot. Defaults to shape.gen = 21 (circle) for genotypes and shape.env = 23 (rhombus) for environments. Values must be between 21-25: 21 (circle), 22 (square), 23 (rhombus), 24 (up triangle), and 25 (low triangle).

size.shape

The size of the shape (both for genotypes and environments). Defaults to 2.2.

size.shape.win

The size of the shape for winners genotypes when type = 3. Defaults to 3.2.

size.bor.tick

The size of tick of shape. Default is 0.3. The size of the shape will be size.shape + size.bor.tick

col.gen, col.env

Color for genotype and environment attributes in the biplot. Defaults to col.gen = 'blue' and col.env = 'forestgreen'

col.alpha

The alpha value for the color. Defaults to 1. Values must be between 0 (full transparency) to 1 (full color).

col.circle, col.alpha.circle

The color and alpha values for the circle lines. Defaults to 'gray' and 0.4, respectively.

leg.lab

The labs of legend. Default is c('Gen', 'Env').

size.text.gen, size.text.env, size.text.lab

The size of the text for genotypes, environments and labels, respectively.

size.line

The size of the line in biplots (Both for segments and circles).

large_label

The text size to use for larger labels where type = 3, used for the outermost genotypes and where type = 9, used for the two selected genotypes. Defaults to 4.5

axis_expand

multiplication factor to expand the axis limits by to enable fitting of labels. Defaults to 1.2

title

Logical values (Defaults to TRUE) to include automatically generated informations in the plot such as singular value partitioning, scaling and centering.

plot_theme

The graphical theme of the plot. Default is plot_theme = theme_metan(). For more details, see theme.

...

Currently not used.

Value

A ggplot2-based biplot.

An object of class gg, ggplot.

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)
plot(mod,
     type = 2,
     col.gen = 'blue',
     col.env = 'red',
     size.text.gen = 2)
# }

Run the code above in your browser using DataLab