| add.diallel.vars | R Documentation |
'add.diallel.vars' adds 4 columns to the provided diallel dataset. Specifically, the user provides a dataset with indicator variables for who is the male and female parent and the function returns the same dataset with 4 new dummy variables to allow the model fit of diallel models.
add.diallel.vars(df, par1="Par1", par2="Par2",sep.cross="-")
df |
a dataset with the two indicator variables for who is the male and female parent. |
par1 |
the name of the column indicating who is the first parent (e.g. male). |
par2 |
the name of the column indicating who is the second parent (e.g. female). |
sep.cross |
the character that should be used when creating the column for cross.id. A simple paste of the columns par1 and par2. |
A new data set with the following 4 new dummy variables to allow the fit of complex diallel models:
returns a 0 if is a self and a 1 for a cross.
returns a 0 if is a cross and a 1 is is a self.
returns a -1 for a direct cross, a 0 for a self and a 1 for a reciprocal cross.
returns a column psting the par1 and par2 columns.
Giovanny Covarrubias-Pazaran
Giovanny Covarrubias-Pazaran (2024). lme4breeding: enabling genetic evaluation in the age of genomic data. To be submitted to Bioinformatics.
Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48.
DT = data.frame(Block=c( rep(1,64), rep(2,64) ),
Par1=c( sort(rep(1:8,8)), sort(rep(1:8,8)) ),
Par2=rep(1:8, 16),
Ftime=rnorm(128)
)
DT2 <- add.diallel.vars(DT,par1="Par1", par2="Par2")
head(DT2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.