####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with one '#' mark,
#### remove them and run the examples
####=========================================####
data("DT_halfdiallel")
DT <- DT_halfdiallel
head(DT)
DT$femalef <- as.factor(DT$female)
DT$malef <- as.factor(DT$male)
DT$genof <- as.factor(DT$geno)
A <- diag(7); colnames(A) <- rownames(A) <- 1:7;A # if you want to provide a covariance matrix
#### model using overlay
modh <- mmer(sugar~1,
random=~vsr(overlay(femalef,malef, sparse = FALSE), Gu=A)
+ genof,
data=DT)
summary(modh)$varcomp
Ai <- as(solve(A + diag(1e-4,ncol(A),ncol(A))), Class="dgCMatrix")
modhb <- mmec(sugar~1,
random=~vsc(isc(overlay(femalef,malef, sparse = TRUE)), Gu=Ai)
+ genof,
data=DT)
summary(modhb)$varcomp
Run the code above in your browser using DataLab