-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in predict.mmer Error in $<-.data.frame
(*tmp*
, start, value = c(1, 2, 3, 4, 5, 13, : replacement has 16 rows, data has 8
#54
Comments
Hi all I have encountered a similar issue to barbosawf. For me, the problem is that there are less rows in the replacement compared to data when I add a 2D-spline to account for spatial effects in my model. Although this is a bit ugly, it seems to work in my case. Please find a reproducible example below. Many thanks!
|
I apologize for the slow response. The predict function for mmer() is indeed a headache, I am trying to rewrite all formulae of mmer but is taking me more than I thought. You can try mmec() and the predict function from that one. That second function uses the ideal formulae and is easy to keep the predict function easy to build. |
On a similar note, I've recently encountered an exception at this line in However, I was wondering what would be the general recommendation moving forward. Should we just use |
Sorry for not getting to this bug yet but I have limited time to improve each of the packages I develop. I would insist to move to use the mmec() function which is the one that has a solid predict function: `library(sommer) get datadata(DT_cpdata) A <- A.mat(GT) fit basic modelm <- mmec(Yield~1, fit model using 2D p-spline for spatial correctionm_spl2Da <- mmec(Yield~1, predictpr_m <- predict(m,D="id") # works plot(pr_m$pvals$predicted.value,pr_m_spl2Da$pvals$predicted.value) # prediction seems OK At some point I will fix the predict function in mmer() just not yet since I am actively developing lme4breeding and evola. None of the packages will be discontinued since they attack different problems through different algorithms. Cheers, |
I have been trying to predict a variable from a model using random regression with the mmer function. However, I am getting the following error:
"Error in `$<-.data.frame`(`*tmp*`, start, value = c(1, 2, 3, 4, 5, 13, : replacement has 16 rows, data has 8"
I tried to find out the error by carefully running the function code and realized that the
start
andend
vectors are longer than the number of lines in theDtable
.That is, when the
start
andend
vectors are created here:They cannot be added here:
Is there a way to fix this?
Here is some information about my model:
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: