Skip to contents

The results of the single_trial_analysis() function are used in met_analysis() to fit multi-environmental trial models. Returns an object of class metAgri, with a list of trial effects, BLUPs, heritability, variance components, stability and the models fitted.

Usage

met_analysis(
  sma_output = NULL,
  h2_filter = 0.2,
  workspace = "1gb",
  vcov = NULL,
  filter_traits = NULL,
  remove_trials = NULL,
  progress = TRUE
)

Arguments

sma_output

Object of class smaAgri resulting of executing single_trial_analysis() function.

h2_filter

Numeric value to filter trials with poor heritability. 0.2 by default.

workspace

Sets the workspace for the core REML routines in the form of a number optionally followed directly by a valid measurement unit. "128mb" by default.

vcov

A character string specifying the Variance-Covariance structure to be fitted. Can be "fa2", "fa1", "us", "corh" or "corv". If NULL the function will try to fit an "us" Variance-Covariance and if it fails, it will try with "fa2" and then with "fa1".

filter_traits

A character vector with traits to filter. NULL by default.

remove_trials

A character vector with trials to remove. NULL by default.

progress

Should the progress of the modeling be printed. If TRUE, for every trait a line is output indicating that the model is being fitted.

Value

An object of class metAgri, with a list of:

trial_effects

A data.frame containing Trial BLUEs.

overall_BLUPs

A data.frame containing Genotypic BLUPs across trials, by trait.

BLUPs_GxE

A data.frame containing Genotypic BLUPs by trial/trait.

VCOV

A list by trait contanining the variance-covariance fitted.

stability

A data.frame containing several Stability coefficients resulting of executing the function stability().

heritability

A data.frame containing overall heritabilities by trait.

met_models

A list by trait containing the fitted models.

Examples

if (FALSE) {
library(agridat)
library(agriutilities)
data(besag.met)
dat <- besag.met
results <- check_design_met(
  data = dat,
  genotype = "gen",
  trial = "county",
  traits = c("yield"),
  rep = "rep",
  block = "block",
  col = "col",
  row = "row"
)
out <- single_trial_analysis(results, progress = FALSE)
met_results <- met_analysis(out, progress = FALSE)
print(met_results)
covcor_heat(matrix = met_results$VCOV$yield$CORR)
}