stackTrait: Stacking traits in a dataset

View source: R/FUN_special.R

stackTraitR Documentation

Stacking traits in a dataset

Description

stackTrait creates a dataset stacking traits in the long format to be used with the mmec solver for multi-trait models.

Usage

  stackTrait(data, traits)

Arguments

data

a data frame with traits in wide format.

traits

variable names corresponding to the traits that should be in the long format.

Value

$res

a data frame with traits in long format.

Author(s)

Giovanny Covarrubias-Pazaran

References

Covarrubias-Pazaran G (2016) Genome assisted prediction of quantitative traits using the R package sommer. PLoS ONE 11(6): doi:10.1371/journal.pone.0156744

See Also

The function vsc to know how to use stackTrait in the mmec solver.

Examples


data(DT_example)
DT <- DT_example
A <- A_example
head(DT)

DT2 <- stackTrait(DT, traits = c("Yield","Weight"))
head(DT2)


sommer documentation built on Sept. 11, 2024, 6:22 p.m.