'how to correct Error in mmer(y = y, Z = ETA, method = "EMMA") : unused arguments (y = y, Z = ETA) in MMER function?
Good Afternoon I am trying to reproduce the scenario1 of your SOMMERs package tutorial in R version 4.1.2 before applying to my data to Case1:Genotypic and phenotypic data for the parents is available and we want to predict performance of the possible crosses assuming a purely additive model (species with no heterosis) with below code
library(sommer)
data(wheatLines)
write.table(wheatLines,"wheatlinesgsdata.csv")
X <- wheatLines$wheatGeno;
X[1:5,1:5];
dim(X)
Y <- wheatLines$wheatPheno
dim(Y)
rownames(X) <- rownames(Y)
#### select environment 1 and create incidence and additive #### relationship matrices
y <- Y[,1] # response grain yield
Z1 <- diag(length(y)) # incidence matrix
K <- A.mat(X) # additive relationship matrix
#### perform the GBLUP pedigree-based approach by ### specifying your random effects (ETA) in a 2-level list ### structure and run it using the mmer function
ETA <- list(add=list(Z=Z1, K=K))
ans <- mmer(y=y, Z=ETA, method="EMMA") # kinship based
names(ans)
summary(ans)
[/CODE]
after running above code i am getting error like in my question even after declaration of y and ETA
**Error in mmer(y = y, Z = ETA, method = "EMMA") : unused arguments (y = y, Z = ETA)**
Can anyone please help me where it went wrong and how to rectify it for my future work.
Thanking you very much
Solution 1:[1]
Please check the documentation. The example used here is based on the original publication but the syntax changed several versions ago. The mmer function takes formulas and not lists as input. Type in your console:
?DT_wheat
and you can see how to fit the exact same dataset you're referring to in the version you're using.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Covaruber |
