Type: | Package |
Title: | Tool for Stability Indices Calculation |
Version: | 0.1.3 |
Author: | Tien-Cheng Wang [aut, cre], Tsu-Wei Chen [com] |
Maintainer: | Tien-Cheng Wang <wangtien@student.hu-berlin.de> |
Description: | Tools to calculate stability indices with parametric, non-parametric and probabilistic approaches. The basic data format requirement for 'toolStability' is a data frame with 3 columns including numeric trait values, genotype,and environmental labels. Output format of each function is the dataframe with chosen stability index for each genotype. Function "table_stability" offers the summary table of all stability indices in this package. This R package toolStability is part of the main publication: Wang, Casadebaig and Chen (2023) <doi:10.1007/s00122-023-04264-7>. Analysis pipeline for main publication can be found on github: https://github.com/Illustratien/Wang_2023_TAAG. Sample dataset in this package is derived from another publication: Casadebaig P, Zheng B, Chapman S et al. (2016) <doi:10.1371/journal.pone.0146385>. For detailed documentation of dataset, please see on Zenodo <doi:10.5281/zenodo.4729636>. Indices used in this package are from: Döring TF, Reckling M (2018) <doi:10.1016/j.eja.2018.06.007>. Eberhart SA, Russell WA (1966) <doi:10.2135/cropsci1966.0011183X000600010011x>. Eskridge KM (1990) <doi:10.2135/cropsci1990.0011183X003000020025x>. Finlay KW, Wilkinson GN (1963) <doi:10.1071/AR9630742>. Hanson WD (1970) Genotypic stability. <doi:10.1007/BF00285245>. Lin CS, Binns MR (1988). Nassar R, Hühn M (1987). Pinthus MJ (1973) <doi:10.1007/BF00021563>. Römer T (1917). Shukla GK (1972). Wricke G (1962). |
Depends: | R (≥ 3.5.0) |
VignetteBuilder: | knitr |
RoxygenNote: | 7.2.3 |
Imports: | dplyr, data.table, Rdpack, nortest, stats |
Suggests: | testthat (≥ 3.0.0), ggplot2, knitr, rmarkdown, pkgdown, pander, XML, httr, RCurl, covr |
RdMacros: | Rdpack |
URL: | https://illustratien.github.io/toolStability/, https://link.springer.com/article/10.1007/s00122-023-04264-7, https://github.com/Illustratien/toolStability, https://github.com/Illustratien/Wang_2023_TAAG, https://doi.org/10.5281/zenodo.4729636 |
BugReports: | https://github.com/Illustratien/toolStability/issues |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
LazyLoad: | true |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-05-15 12:23:36 UTC; marse |
Repository: | CRAN |
Date/Publication: | 2025-05-15 12:50:02 UTC |
toolStability: Tool for Stability Indices Calculation
Description
Tools to calculate stability indices with parametric, non-parametric and probabilistic approaches. The basic data format requirement for 'toolStability' is a data frame with 3 columns including numeric trait values, genotype,and environmental labels. Output format of each function is the dataframe with chosen stability index for each genotype. Function "table_stability" offers the summary table of all stability indices in this package. This R package toolStability is part of the main publication: Wang, Casadebaig and Chen (2023) doi: 10.1007/s00122-023-04264-7. Analysis pipeline for main publication can be found on github: https://github.com/Illustratien/Wang_2023_TAAG. Sample dataset in this package is derived from another publication: Casadebaig P, Zheng B, Chapman S et al. (2016) doi: 10.1371/journal.pone.0146385. For detailed documentation of dataset, please see on Zenodo doi: 10.5281/zenodo.4729636. Indices used in this package are from: Döring TF, Reckling M (2018) doi: 10.1016/j.eja.2018.06.007. Eberhart SA, Russell WA (1966) doi: 10.2135/cropsci1966.0011183X000600010011x. Eskridge KM (1990) doi: 10.2135/cropsci1990.0011183X003000020025x. Finlay KW, Wilkinson GN (1963) doi: 10.1071/AR9630742. Hanson WD (1970) Genotypic stability. doi: 10.1007/BF00285245. Lin CS, Binns MR (1988). Nassar R, Hühn M (1987). Pinthus MJ (1973) doi: 10.1007/BF00021563. Römer T (1917). Shukla GK (1972). Wricke G (1962).
Author(s)
Maintainer: Tien-Cheng Wang wangtien@student.hu-berlin.de
Other contributors:
Tsu-Wei Chen tsu-wei.chen@hu-berlin.de [compiler]
See Also
Useful links:
-
https://link.springer.com/article/10.1007/s00122-023-04264-7
Report bugs at https://github.com/Illustratien/toolStability/issues
Wheat APSIM model simulated database
Description
Multi-environment trail evaluating 5 genotypes in 4 locations for 4 years, with 2 nitrogen application rates, 2 sowing dates, and 2 CO2 levels of treatments (Casadebaig et al., 2016).
Usage
data(Data)
Format
A dataframe with 640 observations on the following 8 variables.
Yield: kg*ha^-1.
Genotype: genotypes, 5 varieties.
Environment: 128 unique combination of environments for each genotype.
Year: 4 years.
Sites: 4 locations.
Nitrogen: 2 nitrogen application levels.
CO2: 2 CO2 concentration levels.
Sowing: 2 sowing dates.
References
Casadebaig P, Zheng B, Chapman S, Huth N, Faivre R, Chenu K (2016). “Assessment of the Potential Impacts of Wheat Plant Traits across Environments by Combining Crop Modeling and Global Sensitivity Analysis.” PLOS ONE, 11(1), e0146385. doi: 10.1371/journal.pone.0146385.
Examples
data(Data)
ggplot2::ggplot(Data,ggplot2::aes(x=Sites,y=Yield,col=Genotype))+
ggplot2::geom_boxplot()+
ggplot2::facet_grid(Sowing~Nitrogen,labeller =ggplot2::label_both)+
ggplot2::ylab(bquote('Wheat yield (ton' %.%'ha'^'-1'*')'))
Adjusted coefficient of variaiton
Description
adjusted_coefficient_of_variation
calculate variance of a genotype across environments.
Usage
adjusted_coefficient_of_variation(data, trait, genotype, environment)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analyzed. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
Details
Adjusted coefficient of variaiton (Doering and Reckling, 2018) is calculatd based on regression function. Variety with low adjusted coefficient of variation is considered as stable. Equation of adjusted coefficient of variation can be found in vignette file.
Value
a data table with adjusted coefficient of variation
Author(s)
Tien-Cheng Wang
References
Döring TF, Reckling M (2018). “Detecting global trends of cereal yield stability by adjusting the coefficient of variation.” European Journal of Agronomy, 99, 30–36. ISSN 1161-0301, doi: 10.1016/j.eja.2018.06.007.
Examples
data(Data)
res <- adjusted_coefficient_of_variation(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment")
Coefficient of determination
Description
coefficient_of_determination
calculate variance of a genotype across environments.
Usage
coefficient_of_determination(data, trait, genotype, environment)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
Details
Coefficient of determination (Pinthus, 1976) is calculatd based on regression function. Variety with low coefficient of determination is considered as stable. Equation of coefficient of determination can be found in vignette file.
Value
a data table with coefficient of determination
Author(s)
Tien-Cheng Wang
References
Pinthus MJ (1973). “Estimate of genotypic value: A proposed method.” Euphytica, 22(1), 121–123. ISSN 1573-5060, doi: 10.1007/BF00021563.
Examples
data(Data)
coef.of.determination <- coefficient_of_determination(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment")
Coefficient of regression
Description
coefficient_of_regression
calculate variance of a genotype across environments.
Usage
coefficient_of_regression(data, trait, genotype, environment)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
Details
Coefficient of regression (Finlay and Wilkinson, 1963) is calculatd based on regression function. Variety with low coefficient of regression is considered as stable. Under the linear model
Y =\mu + b_{i}e_{j} + g_{i} + d_{ij}
where Y is the predicted phenotypic values, g_{i}
, e_{j}
and \mu
denoting
genotypic, environmental and overall population mean,respectively.
The effect of GE-interaction may be expressed as:
(ge)_{ij} = b_{i}e_{j} + d_{ij}
where b_{i}
is the coefficient of regression and d_{ij}
a deviation.
Coefficient of regression may be expressed as:
b_{i}=1 + \frac{\sum_{j} (X_{ij} -\bar{X_{i.}}-\bar{X_{.j}}+\bar{X_{..}})\cdot
(\bar{X_{.j}}- \bar{X_{..}})}{\sum_{j}(\bar{X_{.j}}-\bar{X_{..}})^{2}}
where X_{ij}
is the observed phenotypic mean value of genotype i(i=1,..., G)
in environment j(j=1,...,E), with \bar{X_{i.}}
and \bar{X_{.j}}
denoting marginal means of genotype i and environment j,respectively.
\bar{X_{..}}
denote the overall mean of X.
Value
a data table with coefficient of regression
Author(s)
Tien Cheng Wang
References
Finlay KW, Wilkinson GN (1963). “The analysis of adaptation in a plant-breeding programme.” Australian Journal of Agricultural Research, 14(6), 742–754. doi: 10.1071/AR9630742.
Examples
data(Data)
coefficient.of.regression <- coefficient_of_regression(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment")
Deviation mean squares
Description
deviation_mean_squares
calculate variance of a genotype across environments.
Usage
deviation_mean_squares(
data,
trait,
genotype,
environment,
unit.correct = FALSE
)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
unit.correct |
logical, default is |
Details
Deviation mean squares (Eberhart and Russell, 1966) is calculatd based on regression function. Variety with low stability variance is considered as stable. Equation of deviation mean squares can be found in vignette file.
Value
a data table with deviation mean squares
Author(s)
Tien Cheng Wang
References
Eberhart SA, Russell WA (1966). “Stability parameters for comparing varieties.” Crop Science, 6(1), 36–40. ISSN 0011-183X, doi: 10.2135/cropsci1966.0011183X000600010011x.
Examples
data(Data)
deviation.mean.squares <- deviation_mean_squares(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
unit.correct = FALSE)
Ecovalence
Description
ecovalence
calculate genetic and environmental interaction.
Usage
ecovalence(
data,
trait,
genotype,
environment,
unit.correct = FALSE,
modify = FALSE
)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
unit.correct |
logical, default is |
modify |
logical, default is |
Details
Ecovalence (Wricke, 1962) is calcualted based on square and sum up the genotype–environment interaction all over the environment. Variety with low ecovalence is considered as stable. Equation of ecovalence can be found in vignette file.
Value
a data table with ecovalence
Author(s)
Tien-Cheng Wang
References
Wricke G (1962). “Über eine Methode zur Erfassung der Ökologischen Streubreite in Feldversuchen.” Zeitschrift für Pflanzenzüchtung, 47, 92–96.
Examples
data(Data)
eco.valence <- ecovalence(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
unit.correct = FALSE,
modify=FALSE)
Environmental variance
Description
environmental_variance
is used to calculate variance of a genotype across environments.
Usage
environmental_variance(data, trait, genotype, unit.correct = FALSE)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
unit.correct |
logical, default is |
Details
Environmental variance (Roemer, 1917) is calculated by squared and suming up all deviation from genotypic mean for each genotype. The larger the environmental variance of one genotype is, the lower the stability. Equation of environmental variance can be found in vignette file.
Value
a data table with environmental variance
Author(s)
Tien-Cheng Wang
References
Römer T (1917). “Sind die ertragdreichen Sorten ertagissicherer?” Mitteilungen der Deutschen Landwirtschaftlichen Gesellschaft, 32(1), 87–89.
Examples
data(Data)
environmental.variance <- environmental_variance(
data = Data,
trait = "Yield",
genotype = "Genotype",
unit.correct = FALSE)
Genotypic stability
Description
genotypic_stability
calculate variance of a genotype across environments.
Usage
genotypic_stability(data, trait, genotype, environment, unit.correct = FALSE)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
unit.correct |
logical, default is |
Details
Genotypic stability (Hanson, 1970) is calculatd based on regression function. Variety with low stability variance is considered as stable. Equation of genotypic stability can be found in vignette file.
Value
a data table with genotypic stability
Author(s)
Tien-Cheng Wang
References
Hanson WD (1970). “Genotypic stability.” Theoretical and Applied Genetics, 40(5), 226–231. ISSN 1432-2242, doi: 10.1007/BF00285245.
Examples
data(Data)
genotypic.stability <- genotypic_stability(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
unit.correct = FALSE)
Genotypic superiority measure
Description
genotypic_superiority_measure
calculate variance of a genotype across environments.
Usage
genotypic_superiority_measure(
data,
trait,
genotype,
environment,
unit.correct = FALSE
)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
unit.correct |
logical, default is |
Details
Genotypic superiority measure (Lin and Binns, 1988) is calculatd based on means square distance between maximum value of environment j and genotype i. Variety with low genotypic superiority measure is considered as stable. Equation of genotypic superiority measure can be found in vignette file.
Value
a data table with genotypic superiority measure
Author(s)
Tien-Cheng Wang
References
Lin CS, Binns MR (1988).
“A superiority measure of cultivar performance for cultivar \times
location data.”
Canadian Journal of Plant Science, 68(1), 193–198.
ISSN 0008-4220.
Examples
data(Data)
res <- genotypic_superiority_measure(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
unit.correct = FALSE)
Safety-first Index
Description
safety_first_index
calculate variance of a genotype across environments.
Usage
safety_first_index(data, trait, genotype, environment, lambda)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analyzed. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties. |
environment |
colname of a column containing a character or factor vector labeling different environments. |
lambda |
the minimal acceptable value of trait that the user expected from crop across environments. Lambda should between the ranges of trait vlaue. |
Details
Safety-first index (Eskridge, 1990) is calculated based on the assumption of
that the trait from each genotype follows normal distribution over enviornments.
Among different environments, trait below a given cirtical level \lambda
is defined as failure of trait. The probability of trait failure can be obtained
by entering mean and variance of trait and \lambda
into the cumulated density function of normal distribution.
Variety with low safety first index is considered as stable.
Equation of adjusted coefficient of variation can be found in vignette file.
Value
a data table with coefficient of determination
Author(s)
Tien-Cheng Wang
References
Eskridge KM (1990). “Selection of Stable Cultivars Using a Safety-First Rule.” Crop Science, 30(2), 369. ISSN 0011-183X, doi: 10.2135/cropsci1990.0011183X003000020025x.
Examples
data(Data)
safety.first.index <- safety_first_index(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
lambda = median(Data$Yield))
Stability variance
Description
stability_variance
calculate variance of a genotype across environments.
Usage
stability_variance(data, trait, genotype, environment, unit.correct = FALSE)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analyzed. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties. |
environment |
colname of a column containing a character or factor vector labeling different environments. |
unit.correct |
logical, default is |
Details
Stability variance (Shukla, 1972) is calculatd based on lindear combination of ecovalence and mean square of genotype-environment interaction. Variety with low stability variance is considered as stable. Negative values of stability variance is replaced with 0. Equation of stability variance can be found in vignette file.
Value
a data table with stability variance
Author(s)
Tien-Cheng Wang
References
Shukla GK (1972). “Some statistical aspects of partitioning genotype environmental components of variability.” Heredity, 29(2), 237–245.
Examples
data(Data)
stability.variance <- stability_variance(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment")
Table of stability indices
Description
table_stability
export all the stability indices in the package.
Usage
table_stability(
data,
trait,
genotype,
environment,
lambda,
normalize = FALSE,
unit.correct = FALSE
)
Arguments
data |
a data frame containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analyzed. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties. |
environment |
colname(s) of a column containing a character or factor vector labeling different environments, if input is a vector containing multiple column names, then it will be merged into single environment column in the function. |
lambda |
the minimal acceptable value of trait that the user expected from crop across environments. Lambda should between the ranges of trait vlaue. |
normalize |
logical, default is |
unit.correct |
logical, default is |
Details
Combine all stability indices in this package and export as a table, including mean trait, normality of the trait across environment.
Value
a data table with multiple stability indices
Author(s)
Tien-Cheng Wang
References
Döring TF, Reckling M (2018).
“Detecting global trends of cereal yield stability by adjusting the coefficient of variation.”
European Journal of Agronomy, 99, 30–36.
ISSN 1161-0301, doi: 10.1016/j.eja.2018.06.007.
Pinthus MJ (1973).
“Estimate of genotypic value: A proposed method.”
Euphytica, 22(1), 121–123.
ISSN 1573-5060, doi: 10.1007/BF00021563.
Finlay KW, Wilkinson GN (1963).
“The analysis of adaptation in a plant-breeding programme.”
Australian Journal of Agricultural Research, 14(6), 742–754.
doi: 10.1071/AR9630742.
Eberhart SA, Russell WA (1966).
“Stability parameters for comparing varieties.”
Crop Science, 6(1), 36–40.
ISSN 0011-183X, doi: 10.2135/cropsci1966.0011183X000600010011x.
Wricke G (1962).
“Über eine Methode zur Erfassung der Ökologischen Streubreite in Feldversuchen.”
Zeitschrift für Pflanzenzüchtung, 47, 92–96.
Römer T (1917).
“Sind die ertragdreichen Sorten ertagissicherer?”
Mitteilungen der Deutschen Landwirtschaftlichen Gesellschaft, 32(1), 87–89.
Hanson WD (1970).
“Genotypic stability.”
Theoretical and Applied Genetics, 40(5), 226–231.
ISSN 1432-2242, doi: 10.1007/BF00285245.
Lin CS, Binns MR (1988).
“A superiority measure of cultivar performance for cultivar \times
location data.”
Canadian Journal of Plant Science, 68(1), 193–198.
ISSN 0008-4220.
Shukla GK (1972).
“Some statistical aspects of partitioning genotype environmental components of variability.”
Heredity, 29(2), 237–245.
Nassar R, Hühn M (1987).
“Studies on estimation of phenotypic stability: Tests of significance for nonparametric measures of phenotypic stability.”
Biometrics, 43(1), 45–53.
ISSN 0006-341X.
Eskridge KM (1990).
“Selection of Stable Cultivars Using a Safety-First Rule.”
Crop Science, 30(2), 369.
ISSN 0011-183X, doi: 10.2135/cropsci1990.0011183X003000020025x.
See Also
adjusted_coefficient_of_variation
Examples
data(Data)
tb <- table_stability(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
lambda = median(Data$Yield),
normalize = TRUE,
unit.correct=TRUE)
variance of rank
Description
variance_of_rank
calculate variance of a genotype across environments.
Usage
variance_of_rank(data, trait, genotype, environment, unit.correct = FALSE)
Arguments
data |
a dataframe containing trait, genotype and environment. |
trait |
colname of a column containing a numeric vector of interested trait to be analysized. |
genotype |
colname of a column containing a character or factor vector labeling different genotypic varieties |
environment |
colname of a column containing a character or factor vector labeling different environments |
unit.correct |
logical, default is |
Details
Variance of rank (Nassar and Huehn, 1987) is calculatd based on regression function. Variety with low variance of rank is considered as stable. Equation of variance of rank can be found in vignette file.
Value
a data table with variance of rank
Author(s)
Tien-Cheng Wang
References
Nassar R, Hühn M (1987). “Studies on estimation of phenotypic stability: Tests of significance for nonparametric measures of phenotypic stability.” Biometrics, 43(1), 45–53. ISSN 0006-341X.
Examples
data(Data)
variance.of.rank <- variance_of_rank(
data = Data,
trait = "Yield",
genotype = "Genotype",
environment = "Environment",
unit.correct = FALSE)