Learn R Programming

sommer (version 4.3.5)

stackTrait: 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)

Value

$res

a data frame with traits in long format.

Arguments

data

a data frame with traits in wide format.

traits

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

Author

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

Run this code

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

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

Run the code above in your browser using DataLab