cran/sommer

Error in the predict function Error in `$<-.data.frame`(`*tmp*`, start, value = c(1, 2, 3, 4, 5, 13, : replacement has 16 rows, data has 8

barbosawf opened this issue · 1 comments

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 and end vectors are longer than the number of lines in the Dtable.

That is, when the start and end vectors are created here:

   start = end = numeric()
   add <- 1
   for (i in 1:length(effectsN)) {
     start[i] = add
     end[i] = start[i] + effectsN[i] - 1
     add = end[i] + 1
   }

They cannot be added here:

     Dtable$start <- start
     Dtable$end <- end

Is there a way to fix this?

Here is some information about my model:
image

Thank you very much in advance!

Hi, this is a read only mirror of CRAN, please see the package authors in the DESCRIPTION file. Look for Maintainer, BugReports and URL. Thanks!