plot.scores: Plot scores in different graphical interpretations

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.scores.R

Description

Plot scores of genotypes and environments in different graphics. 1 = PC1 x PC2, 2 = GY x PC1, 3 = GY x WAASB, and 4 = Nominal yield x EPCA1.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'scores'
plot(x, type = 1, polygon = FALSE, file.type = "pdf",
     export = FALSE, file.name = NULL, theme = theme_waasb(),
     axis.expand = 1.1, width = 8, height = 7, x.lim = NULL,
     x.breaks = waiver(), x.lab = NULL, y.lab = NULL, y.lim = NULL,
     y.breaks = waiver(), shape.gen = 21, shape.env = 23,
     size.shape = 2.2, size.bor.tick = 0.3, size.tex.lab = 12,
     size.tex.pa = 3.5, size.line = 0.5, size.segm.line = 0.5,
     leg.lab = c("Gen", "Env"), line.type = "solid", line.alpha = 0.9,
     col.line = "gray", col.gen = "blue", col.env = "darkgreen",
     col.alpha = 0.9, col.segm.gen = "transparent",
     col.segm.env = "darkgreen", resolution = 300, ...)

Arguments

x

The object WAASB or WAAS.AMMI

type

Three types of graphics can be generated: 1 = PC1 x PC2, default, to make inferences related to the interaction effects; 2 = GY x PC1 to make inferences related to stability and productivity; 3 = GY x WAASB, and 4 = Nominal yield x Environment PC1.

polygon

Logical argument. If TRUE, a polygon is drawn when type 1.

file.type

The type of file to be exported. Valid parameter if export = T|TRUE. Default is "pdf". The graphic can also be exported in *.tiff format by declaring file.type = "tiff".

export

Export (or not) the plot. Default is FALSE.

file.name

The name of the file for exportation, default is NULL, i.e. the files are automatically named.

theme

The graphical theme of the plot. Default is 'theme = theme_waasb()'. Please, see '?WAASB::theme_waasb'. An own theme can be applied using the arguments: 'theme = theme_waasb() + theme(some stuff here)'. For more details, please, see '?ggplot2::theme'

axis.expand

Multiplication factor to expand the axis limits by to enable fitting of labels. Default is 1.1.

width

The width "inch" of the plot. Default is 8.

height

The height "inch" of the plot. Default is 7.

x.lim

The range of x-axis. Default is NULL (maximum and minimum values of the data set). New arguments can be inserted as x.lim = c(x.min, x.max).

x.breaks

The breaks to be plotted in the x-axis. Default is authomatic breaks. New arguments can be inserted as x.breaks = c(breaks)

x.lab

The label of x-axis. Each plot has a default value. New arguments can be inserted as x.lab = "my label".

y.lab

The label of y-axis. Each plot has a default value. New arguments can be inserted as y.lab = "my label".

y.lim

The range of x-axis. Default is NULL. The same arguments than x.lim can be used.

y.breaks

The breaks to be plotted in the x-axis. Default is authomatic breaks. The same arguments than x.breaks can be used.

shape.gen

The shape for genotype indication in the biplot. Default is 21 (circle). Values must be between 21-25: 21 (circle), 22 (square), 23 (diamond), 24 (up triangle), and 25 (low triangle).

shape.env

The shape for environment indication in the biplot. Default is 23 (diamond). The same arguments than "shape.gen".

size.shape

The size of the shape (both for genotypes and environments). Default is 2.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

size.tex.lab

The size of the text in the axes text and labels. Default is 12.

size.tex.pa

The size of the text of the plot area. Default is 3.5.

size.line

The size of the line that indicate the means in the biplot. Default is 0.5.

size.segm.line

The size of the segment that start in the origin of the biplot and end in the scores values. Default is 0.5.

leg.lab

The labs of legend. Default is Gen and Env.

line.type

The type of the line that indicate the means in the biplot. Default is "solid". Other values that can be attributed are: "blank", no lines in the biplot, "dashed", "dotted", "dotdash", "longdash", and "twodash".

line.alpha

The alpha value that combine the line with the background to create the appearance of partial or full transparency. Default is 0.4. Values must be between "0" (full transparency) to "1" (full color).

col.line

The color of the line that indicate the means in the biplot. Default is "gray"

col.gen

The shape color for genotypes. Must be one value or a vector of colours with the same length of the number of genotypes. Default is "blue". Other values can be attributed. For example, "transparent", will make a plot with only an outline around the shape area.

col.env

The shape color for environments. Default is "red". The same usability than "col.gen".

col.alpha

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

col.segm.gen

The color of segment for genotypes.Default is "transparent". Parameter valid for type = 1 and type = 2 graphics. This segment start in the origin of the biplot and end in the scores values.

col.segm.env

The color of segment for environments. Default is "gray50". The same usability than "col.segm.gen"

resolution

The resolution of the plot. Parameter valid if file.type = "tiff" is used. Default is 300 (300 dpi)

...

Other arguments of the function

Details

The plots type 1 and 2 have the same interpretation than those used in traditional-usage AMMI analysis (well know as AMMI2 and AMMI1, respectively). In the plot type 3, the scores of both genotypes and environments are plotted considering the response variable and the WAASB (stability index that considers all significant principal component axis of traditional AMMI models or all principal component axis estimated with BLUP-interaction effects. 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.

Author(s)

Tiago Olivoto [email protected]

See Also

plot.eigen, plot.validation.AMMIF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library(METAAB)
library(ggplot2)
scores = WAASB(data_ge,
               resp = GY,
               gen = GEN,
               env = ENV,
               rep = REP)
# PC1 x PC2
plot.scores(scores$GY,
            type = 1,
            polygon = TRUE)

# GY x PC1
plot.scores(scores$GY,
            type = 2,
            col.env = "olivedrab",
            col.gen = "orange2",
            x.lab = "My own x label")

# GY x WAASB
plot.scores(scores$GY,
            type = 3,
            size.tex.pa = 2,
            size.tex.lab = 16)

TiagoOlivoto/WAASB documentation built on April 1, 2019, 10:25 a.m.