Error: Subscript `AMr1.orig` is a matrix, the data `x.imp[, -possibleFactors][AMr1.orig]` must have size 1
vincentarelbundock opened this issue · comments
Vincent Arel-Bundock commented
In case you had not seen this StackOverflow error report from 2020:
I just ran into the same problem. The solution is simple. Just add this to convert x
to data frame if it is a tibble
:
if (inherits(x, "tbl_df")) {
x <- as.data.frame(x)
}
Vincent Arel-Bundock commented
FWIW, I ran into this issue with a complex dataset today. Hard to create a minimal reproducible example, but the SO question and answer have a lot of likes and comments, so I think the bug should be treated as "replicated on several machines."
M. Emre Coskun commented
Ran into this problem recently, and spent an hour trying to understand what was wrong. Fortunately, the SO post helped me resolve it. A bug fix would be helpful.