metan (version 1.2.1)

anova_ind: Within-environment analysis of variance

Description

This is a helper function that performs a within-environment analysis of variance and returns values such as Mean Squares, p-values, coefficient of variation, heritability, and accuracy of selection.

Usage

anova_ind(.data, env, gen, rep, resp, verbose = TRUE)

Arguments

.data

The dataset containing the columns related to Environments, Genotypes, replication/block and response variable(s).

env

The name of the column that contains the levels of the environments. The analysis of variance is computed for each level of this factor.

gen

The name of the column that contains the levels of the genotypes.

rep

The name of the column that contains the levels of the replications/blocks.

resp

The response variable(s). To analyze multiple variables in a single procedure a vector of variables may be used. For example resp = c(var1, var2, var3).

verbose

Logical argument. If verbose = FALSE the code will run silently.

Value

A list where each element is the result for one variable and contains:

  • individual A data frame with the results of the individual analysis of variance.

  • MSRatio The ratio between the higher and lower residual mean square.

Examples

Run this code
# NOT RUN {
library(metan)
# traditional usage approach
data = data_ge
anova1 = anova_ind(data_ge,
                   env = ENV,
                   gen = GEN,
                   rep = REP,
                   resp = GY)

# Using the pipe operator %>%
# Two variables, one run.
anova2 <- data_ge %>% anova_ind(ENV, GEN, REP, GY)


# }

Run the code above in your browser using DataCamp Workspace