IQSS / Amelia

Amelia: A Package for Missing Data

Home Page:http://gking.harvard.edu/amelia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Subscript `AMr1.orig` is a matrix, the data `x.imp[, -possibleFactors][AMr1.orig]` must have size 1

vincentarelbundock opened this issue · comments

In case you had not seen this StackOverflow error report from 2020:

https://stackoverflow.com/questions/64056125/how-to-fix-erreur-subscript-amr1-orig-is-a-matrix-the-data-x-imp-possib

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)
}

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."

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.