plot_scores | R Documentation |
Plot scores of genotypes and environments in different graphical interpretations.
Biplots type 1 and 2 are well known in AMMI analysis. In the plot type 3, the scores of both genotypes and environments are plotted considering the response variable and the WAASB, an stability index that considers all significant principal component axis of traditional AMMI models or all principal component axis estimated with BLUP-interaction effects (Olivoto et al. 2019). Plot type 4 may be used to better understand the well known 'which-won-where' pattern, facilitating the recommendation of appropriate genotypes targeted for specific environments, thus allowing the exploitation of narrow adaptations.
plot_scores( x, var = 1, type = 1, first = "PC1", second = "PC2", repel = TRUE, repulsion = 1, max_overlaps = 20, polygon = FALSE, title = TRUE, plot_theme = theme_metan(), axis.expand = 1.1, x.lim = NULL, y.lim = NULL, x.breaks = waiver(), y.breaks = waiver(), x.lab = NULL, y.lab = NULL, shape.gen = 21, shape.env = 23, size.shape.gen = 2.2, size.shape.env = 2.2, size.bor.tick = 0.1, size.tex.lab = 12, size.tex.gen = 3.5, size.tex.env = 3.5, size.line = 0.5, size.segm.line = 0.5, col.bor.gen = "black", col.bor.env = "black", col.line = "black", col.gen = "blue", col.env = "forestgreen", col.alpha.gen = 1, col.alpha.env = 1, col.segm.gen = transparent_color(), col.segm.env = "forestgreen", highlight = NULL, col.highlight = "red", col.alpha.highlight = 1, size.tex.highlight = 5.5, size.shape.highlight = 3.2, leg.lab = c("Env", "Gen"), line.type = "solid", line.alpha = 0.9, resolution = deprecated(), file.type = "png", export = FALSE, file.name = NULL, width = 8, height = 7, color = TRUE, ... )
x |
An object fitted with the functions |
var |
The variable to plot. Defaults to |
type |
type of biplot to produce
|
first, second |
The IPCA to be shown in the first (x) and second (y)
axis. By default, IPCA1 is shown in the |
repel |
If |
repulsion |
Force of repulsion between overlapping text labels. Defaults
to |
max_overlaps |
Exclude text labels that overlap too many things. Defaults to 20. |
polygon |
Logical argument. If |
title |
Logical values (Defaults to |
plot_theme |
The graphical theme of the plot. Default is
|
axis.expand |
Multiplication factor to expand the axis limits by to
enable fitting of labels. Default is |
x.lim, y.lim |
The range of x and y axes, respectively. Default is
|
x.breaks, y.breaks |
The breaks to be plotted in the x and y axes,
respectively. Defaults to |
x.lab, y.lab |
The label of x and y axes, respectively. Defaults to
|
shape.gen, shape.env |
The shape for genotypes and environments
indication in the biplot. Default is |
size.shape.gen, size.shape.env |
The size of the shapes for genotypes and
environments respectively. Defaults to |
size.bor.tick |
The size of tick of shape. Default is |
size.tex.lab, size.tex.gen, size.tex.env |
The size of the text for axis labels (Defaults to 12), genotypes labels, and environments labels (Defaults to 3.5). |
size.line |
The size of the line that indicate the means in the biplot.
Default is |
size.segm.line |
The size of the segment that start in the origin of the
biplot and end in the scores values. Default is |
col.bor.gen, col.bor.env |
The color of the shape's border for genotypes and environments, respectively. |
col.line |
The color of the line that indicate the means in the biplot.
Default is |
col.gen, col.env |
The shape color for genotypes (Defaults to
|
col.alpha.gen, col.alpha.env |
The alpha value for the color for
genotypes and environments, respectively. Defaults to |
col.segm.gen, col.segm.env |
The color of segment for genotypes (Defaults
to |
highlight |
Genotypes/environments to be highlight in the plot. Defaults
to |
col.highlight |
The color for shape/labels when a value is provided in
|
col.alpha.highlight |
The alpha value for the color of the highlighted
genotypes. Defaults to |
size.tex.highlight |
The size of the text for the highlighted genotypes.
Defaults to |
size.shape.highlight |
The size of the shape for the highlighted
genotypes. Defaults to |
leg.lab |
The labs of legend. Default is |
line.type |
The type of the line that indicate the means in the biplot.
Default is |
line.alpha |
The alpha value that combine the line with the background
to create the appearance of partial or full transparency. Default is
|
resolution |
deprecated |
file.type |
The type of file to be exported. Currently recognises the extensions eps/ps, tex, pdf, jpeg, tiff, png (default), bmp, svg and wmf (windows only). |
export |
Export (or not) the plot. Default is |
file.name |
The name of the file for exportation, default is
|
width |
The width 'inch' of the plot. Default is |
height |
The height 'inch' of the plot. Default is |
color |
Should type 4 plot have colors? Default to |
... |
Currently not used. |
An object of class gg, ggplot
.
Tiago Olivoto tiagoolivoto@gmail.com
Olivoto, T., A.D.C. L\'ucio, J.A.G. da silva, V.S. Marchioro, V.Q. de Souza, and E. Jost. 2019. Mean performance and stability in multi-environment trials I: Combining features of AMMI and BLUP techniques. Agron. J. 111:2949-2960. doi: 10.2134/agronj2019.03.0220
plot_eigen()
library(metan) # AMMI model model <- waas(data_ge, env = ENV, gen = GEN, rep = REP, resp = everything()) # GY x PC1 for variable GY (default plot) plot_scores(model) # PC1 x PC2 (variable HM) # plot_scores(model, polygon = TRUE, # Draw a convex hull polygon var = "HM", # or var = 2 to select variable highlight = c("G1", "G2"), # Highlight genotypes 2 and 3 type = 2) # type of biplot # PC3 x PC4 (variable HM) # Change size of plot fonts and colors # Minimal theme plot_scores(model, var = "HM", type = 2, first = "PC3", second = "PC4", col.gen = "black", col.env = "gray", col.segm.env = "gray", size.tex.gen = 5, size.tex.env = 2, size.tex.lab = 16, plot_theme = theme_metan_minimal()) # WAASB index waasb_model <- waasb(data_ge, ENV, GEN, REP, GY) # GY x WAASB # Highlight genotypes 2 and 8 plot_scores(waasb_model, type = 3, highlight = c("G2", "G8"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.