Title: | GGE Biplots with 'ggplot2' |
---|---|
Description: | Genotype plus genotype-by-environment (GGE) biplots rendered using 'ggplot2'. Provides a command line interface to all of the functionality contained within the archived package 'GGEBiplotGUI'. |
Authors: | Sam Dumble [aut, cre], Elisa Frutos Bernal [ctb], Purificacion Galindo Villardon [ctb] |
Maintainer: | Sam Dumble <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-11-15 03:51:07 UTC |
Source: | https://github.com/cran/GGEBiplots |
Compare the performance of two genotypes across all environments
CompareGens(GGEModel, G1, G2, ...)
CompareGens(GGEModel, G1, G2, ...)
GGEModel |
An object of class |
G1 |
genotype to compare. Must be a string which matches a genotype label |
G2 |
genotype to compare. Must be a string which matches a genotype label and not equal to G1 |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) CompareGens(GGE1,"cas","luc")
data(Ontario) GGE1<-GGEModel(Ontario) CompareGens(GGE1,"cas","luc")
Evaluating the environments based on both discriminating ability and representativeness
DiscRep(GGEModel, ...)
DiscRep(GGEModel, ...)
GGEModel |
An object of class |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) DiscRep(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) DiscRep(GGE1)
Relationship between environments
EnvRelationship(GGEModel, ...)
EnvRelationship(GGEModel, ...)
GGEModel |
An object of class |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) EnvRelationship(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) EnvRelationship(GGE1)
Ranking the cultivars based on their performance in any given environment
ExamineEnv(GGEModel, Env, ...)
ExamineEnv(GGEModel, Env, ...)
GGEModel |
An object of class |
Env |
environment to examine. Must be a string which matches an environment label |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) ExamineEnv(GGE1,"WP93")
data(Ontario) GGE1<-GGEModel(Ontario) ExamineEnv(GGE1,"WP93")
Ranking the environments based on the relative performance of any given cultivar
ExamineGen(GGEModel, Gen, ...)
ExamineGen(GGEModel, Gen, ...)
GGEModel |
An object of class |
Gen |
genotype to examine. Must be a string which perfectly matches an genotype label |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) ExamineGen(GGE1,"cas")
data(Ontario) GGE1<-GGEModel(Ontario) ExamineGen(GGE1,"cas")
Calculates the GGE model where presented with a two way table of means with
genotypes in rows, where genotype names are set as row names, and
environments in columns, where environment names are set as column names.
This function serves as a command line interface to the internal code
contained within the archived package 'GGEBiplotGUI'. For dealing with
missing data then a better implementation is available through
gge
.
GGEModel(Data, centering = "tester", scaling = "none", SVP = "column")
GGEModel(Data, centering = "tester", scaling = "none", SVP = "column")
Data |
a data frame or matrix containing genotype by environment means with the genotypes in rows and the environments in columns. row names and column names should be set to indicate the genotype names and environment names. |
centering |
centering method. Either "tester" for tester centered
(G+GE), "global" for global centered (E+G+GE), "double" for double centred
(GE) or "none" for no centering. Models produced without centering cannot
be used in the |
scaling |
scaling method. Either "sd" for standard deviation or "none" for no scaling. |
SVP |
method for singular value partitioning. Either "row","column","dual" or "symmetrical". |
A list of class GGEModel
containing:
coordgenotype |
plotting coordinates for genotypes from all components |
coordenviroment |
plotting coordinates for environments from all components |
eigenvalues |
vector of eigenvalues from each component |
vartotal |
overall variance |
varexpl |
percentage of variance explained by each component |
labelgen |
genotype names |
labelenv |
environment names |
axes |
axis labels |
Data |
scaled and centered input data |
centering |
name of centering method |
scaling |
name of scaling method |
SVP |
name of SVP method |
Yan W, Kang M (2003). GGE Biplot Analysis: A Graphical Tool for Breeders, Geneticists, and Agronomists. CRC Press.
Yan W, Kang M (2002). Singular-Value Partitioning in Biplot Analysis of Multienvironment Trial Data. Agronomy Journal, 94, 990-996. doi:10.2134/agronj2002.0990
data(Ontario) GGE1<-GGEModel(Ontario) GGEPlot(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) GGEPlot(GGE1)
Produces the GGE biplot as an object of class 'ggplot' from a model produced
by a call to either GGEModel
or
gge
. Nearly all stylistic attributes of output can either
be customised within the function or disabled so that the user can customise
output to their own liking.
GGEPlot( GGEModel, type = 1, d1 = 1, d2 = 2, selectedE = NA, selectedG = NA, selectedG1 = NA, selectedG2 = NA, colSegment = "red", colHull = "black", largeSize = 4.5, axis_expand = 1.2, axislabels = TRUE, axes = TRUE, limits = TRUE, titles = TRUE, footnote = TRUE, textGen = element_text(family = "", face = 1, color = "forestgreen", size = 4, hjust = 0, vjust = 0, angle = 0), textEnv = element_text(family = "", face = 1, color = "blue", size = 4, hjust = 0, vjust = 0, angle = 0) )
GGEPlot( GGEModel, type = 1, d1 = 1, d2 = 2, selectedE = NA, selectedG = NA, selectedG1 = NA, selectedG2 = NA, colSegment = "red", colHull = "black", largeSize = 4.5, axis_expand = 1.2, axislabels = TRUE, axes = TRUE, limits = TRUE, titles = TRUE, footnote = TRUE, textGen = element_text(family = "", face = 1, color = "forestgreen", size = 4, hjust = 0, vjust = 0, angle = 0), textEnv = element_text(family = "", face = 1, color = "blue", size = 4, hjust = 0, vjust = 0, angle = 0) )
GGEModel |
An object of class |
type |
type of biplot to produce.
|
d1 |
PCA component to plot on x axis. Defaults to 1 |
d2 |
PCA component to plot on y axis. Defaults to 2 |
selectedE |
name of the environment to examine when type=2. Must be a string which matches an environment label |
selectedG |
name of the genotype to examine when type=3. Must be a string which matches a genotype label |
selectedG1 |
name of a genotype to compare when type=5. Must be a string which matches a genotype label |
selectedG2 |
name of a genotype to compare when type=5. Must be a string which matches a genotype label and not equal to selectedG1 |
colSegment |
colour for segment or circle lines. Defaults to "red" |
colHull |
colour for hull when type=6. Defaults to "black" |
largeSize |
text size to use for larger labels where type=5, used for the two selected genotypes, and where type=6, used for the outermost genotypes. Defaults to 4.5 |
axis_expand |
multiplication factor to expand the axis limits by to enable fitting of labels. Defaults to 1.2 |
axislabels |
logical. If TRUE then include automatically generated labels for axes |
axes |
logical. If TRUE then include x and y axes going through the origin |
limits |
logical. If TRUE then automatically rescale axes |
titles |
logical. If TRUE then include automatically generated titles |
footnote |
logical. If TRUE then include automatically generated footnote |
textGen |
element_text for genotype labels |
textEnv |
element_text for environment labels |
A biplot of class ggplot
Yan W, Kang M (2003). GGE Biplot Analysis: A Graphical Tool for Breeders, Geneticists, and Agronomists. CRC Press.
data(Ontario) GGE1<-GGEModel(Ontario) GGEPlot(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) GGEPlot(GGE1)
Evaluating cultivars based on both average yield and stability
MeanStability(GGEModel, ...)
MeanStability(GGEModel, ...)
GGEModel |
An object of class |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) MeanStability(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) MeanStability(GGE1)
The sample data are yields from the 1993 Ontario winter wheat (Triticum aestivum L.) performance trials, in which 18 cultivars were tested at nine locations (Yan and Kang 2003). Duplicated from the archived package 'GGEBiplotGUI'.
data(Ontario)
data(Ontario)
A data frame with 18 observations on the following 10 variables.
Yan W, Kang MS (2003). “GGE Biplot Analysis: A Graphical Tool for Breeders, Geneticists, and Agronomists.” CRC Press, Boca Raton, FL, USA.
data(Ontario)
data(Ontario)
Ranking environments with respect to the ideal environment
RankEnv(GGEModel, ...)
RankEnv(GGEModel, ...)
GGEModel |
An object of class |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) RankEnv(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) RankEnv(GGE1)
Ranking genotypes with respect to the ideal genotype
RankGen(GGEModel, axis_expand = 1.4, ...)
RankGen(GGEModel, axis_expand = 1.4, ...)
GGEModel |
An object of class |
axis_expand |
multiplication factor to expand the axis limits by to enable fitting of labels. Defaults to 1.4 for genotype ranking plot as the circles usually extend beyond limits of the other biplot types. |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) RankGen(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) RankGen(GGE1)
Transforms raw data into a simple two-way table for use in
GGEModel
with row names and column names. By design
rather than just a side-effect of combining list
with tapply
stattable(rowfactor, columnfactor, outcome, FUN = mean, ...)
stattable(rowfactor, columnfactor, outcome, FUN = mean, ...)
rowfactor |
variable to be included in the rows |
columnfactor |
variable to be included in the columns |
outcome |
vector containing outcome values |
FUN |
name of summary function to use |
... |
other arguments for |
simdata<-data.frame(expand.grid(Genotype=1:10,Environment=1:10,Rep=1:3),Outcome=rnorm(300)) meantab<-stattable(simdata$Genotype,simdata$Environment,simdata$Outcome,FUN=mean,na.rm=TRUE) GGEPlot(GGEModel(meantab))
simdata<-data.frame(expand.grid(Genotype=1:10,Environment=1:10,Rep=1:3),Outcome=rnorm(300)) meantab<-stattable(simdata$Genotype,simdata$Environment,simdata$Outcome,FUN=mean,na.rm=TRUE) GGEPlot(GGEModel(meantab))
Identifying the 'best' cultivar in each environment
WhichWon(GGEModel, ...)
WhichWon(GGEModel, ...)
GGEModel |
An object of class |
... |
Other arguments sent to |
data(Ontario) GGE1<-GGEModel(Ontario) WhichWon(GGE1)
data(Ontario) GGE1<-GGEModel(Ontario) WhichWon(GGE1)