Learn R Programming

toolStability (version 0.1.2)

environmental_variance: Environmental variance

Description

environmental_variance is used to calculate variance of a genotype across environments.

Usage

environmental_variance(data, trait, genotype, unit.correct = FALSE)

Value

a data table with environmental variance

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 FALSE, returning the stability index with unit equals to squared unit of trait; when TRUE, returning stability index with the unit as same as unit of trait.'

Author

Tien-Cheng Wang

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.

References

roemer1917toolStability

Examples

Run this code
data(Data)
environmental.variance <- environmental_variance(
 data = Data,
 trait = "Yield",
 genotype = "Genotype",
 unit.correct = FALSE)

Run the code above in your browser using DataLab