Any ideas why the below code snippet (from spatialEco::insert function) would be returning a data length differs from size of matrix warning on a CRAN check? I cannot recreate this warning but, am getting an email from CRAN that a large group of packages is getting this warning on check of examples. One of mine got flagged and I am not sure of the source of the error. This packages (and this specific function) has been around for sometime, why am I getting a check warning now? The other 65 package maintainers are probably asking themself the same question.
Admittedly, I am probably being dense and missing something here but, I have run the package through: rcmdchec::rcmdcheck (with various flag combinations), rcmdchec::compare_to_cran (with all available flavors) as well as submitting to https://win-builder.r-project.org/ and https://builder.r-hub.io and cannot recreate the warning.
x <- data.frame(ID=1:10, y=runif(10))
idx =2
value = rep(NA, nrow(x))
x[seq(idx+1, nrow(x)+1),] <- x[seq(idx, nrow(x)),]
x[idx,] <- value
Here is the resulting warning that CRAN indicates is being returned. It seems to have something to do with piping in new values but, not sure why this is suddenly returning a warning and why it is a matrix size issue.
annet% grep -r "data length differs from size of matrix" spatialEco.Rcheck/ spatialEco.Rcheck/spatialEco-Ex.Rout: data length differs from size of matrix: [10 != 1 x 2]
Warning in matrix(value, n, p) : data length differs from size of matrix: [10 != 1 x 2]
traceback() 9: matrix(value, n, p) 8:
[<-.data.frame(*tmp*, idx, , value = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)) 7:[<-(*tmp*, idx, , value = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)) 6: insert(d, idx = 2) at Rex1c630657f5bf04#10