check_design_met {agriutilities}R Documentation

Check Experimental Design

Description

This function helps to identify the experimental design of each trial, filters the data and then provide a summary for the traits and the experimental design. This works as a quality check before we fit any model. Returns an object of class checkAgri.

Usage

check_design_met(
  data = NULL,
  genotype = NULL,
  trial = NULL,
  traits = NULL,
  rep = NULL,
  block = NULL,
  row = NULL,
  col = NULL
)

Arguments

data

A data.frame in a wide format.

genotype

A character string indicating the column in data that contains genotypes.

trial

A character string indicating the column in data that contains trials.

traits

A character vector specifying the traits for which the models should be fitted.

rep

A character string indicating the column in data that contains replicates.

block

A character string indicating the column in data that contains sub blocks.

row

A character string indicating the column in data that contains the row coordinates.

col

A character string indicating the column in data that contains the column coordinates.

Value

An object of class checkAgri, with a list of:

summ_traits

A data.frame containing a summary of the traits.

exp_design_resum

A data.frame containing a summary of the experimental design.

filter

A list by trait containing the filtered trials.

exp_design_list

A data.frame containing the experimental design of each trial.

check_connectivity

A data.frame with the genotype connectivity.

connectivity_matrix

A matrix with the amount of genotypes shared between each pair of trial.

data_design

A data frame containing the data used with two additional columns, one realted to the experimental design and a sequential number (id)

inputs

A list containing the character string that indicates the column in data that contains the genotype, trial, traits, rep, block, row and col.

Examples

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"
)
print(results)
plot(results, type = "connectivity")
plot(results, type = "missing")

[Package agriutilities version 1.2.0 Index]