make_phenotypes {FieldSimR}R Documentation

Generate phenotypes - Combine genetic values and plot errors

Description

Creates a data frame of phenotypes by combining genetic values with plot errors generated with the function field_trial_error. Requires genetic values generated with the functions compsym_asr_output or unstr_asr_output, or any data frame matching the description below.

Usage

make_phenotypes(gv.df, error.df, randomise = FALSE, return.effects = FALSE)

Arguments

gv.df

A data frame of genetic values. Must contain the columns 'env', 'rep', genotype 'id', and the genetic values for each trait.

error.df

A data frame of plot errors. Must contain the columns 'env', 'block', 'col', 'row', and the plot errors for each trait.

randomise

When TRUE (default is FALSE), genotypes are randomly allocated to plots according to a randomized complete block design (RCBD).
Note: Other experimental designs are being implemented and should be generated externally.

return.effects

When TRUE (default is FALSE), a list is returned with additional entries containing the genetic values and plot errors for each trait.

Value

A data frame with columns 'env', 'block', 'column', 'row', genotype 'id', and the phenotypes for each trait. When return.effects = TRUE, a list is returned with additional entries containing the genetic values and plot errors for each trait.

Examples

# Generate phenotypes by combining the genetic values and plot errors provided
# in the two example data frames gv_df_unstr and error_df_bivar.

pheno_df <- make_phenotypes(
  gv.df = gv_df_unstr,
  error.df = error_df_bivar,
  randomise = TRUE,
  return.effects = TRUE
)


[Package FieldSimR version 1.3.0 Index]