Why is R not recognizing the data input in my 'data' argument?

190 Views Asked by At

I am trying to use the sommer package to calculate narrow-sense heritability of a trait in my wheat population. Because I keep encountering the same error when inputting my data, I decided to follow the tutorial, using its provided sample data. I get the same error message.

#install.packages("sommer")
library("sommer")
data(CPdata) # CPgeno, CPpheno, and CPmap load to the Environment
CPpheno$idd <-CPpheno$id; CPpheno$ide <-CPpheno$id

A <- A.mat(CPgeno) # additive relationship matrix
D <- D.mat(CPgeno) # dominance relationship matrix
E <- E.mat(CPgeno) # epistatic relationship matrix

ans.ADE <- mmer2(color~1,
            random=~g(id) + g(idd) + g(ide),
            rcov=~units,
            G=list(id=A,idd=D,ide=E),
            data= CPpheno)

Running this always results in the same error code:

Error: Please provide the 'data' argument for your specified variables

Why does it not see that I have indeed provided the data argument?

0

There are 0 best solutions below