I\'m trying to multiply impute some data, and it\'s failing in a very odd way. I have options(error=recover) set, and mi() doesn\'t throw an error, but it does stop imputin
Since the error=recover
option is not working, an alternative that does work is to set options(error=dump.frames)
. That will get you some information about the error, which you can either print out or, more usefully, examine with debugger()
ls()
# [1] "dat"
options(error=dump.frames)
mi(dat)
ls()
# [1] "dat" "last.dump" # Apparently there WAS an error
# INVESTIGATE WITH debugger()
debugger(dump=last.dump)
# ALTERNATIVELY, PRINT last.dump TO CONSOLE
last.dump
$`mi(dat)`
<environment: 0x05155c44>
$`mi(dat)`
<environment: 0x05158f30>
$`.local(object, ...)`
<environment: 0x05158cac>
$`mi.default(object, info, n.imp, n.iter, R.hat, max.minutes, rand.imp.method`
<environment: 0x047dc3a0>
attr(,"error.message")
[1] "Error in aveVar[s, i, ] <- c(avevar.mean, avevar.sd) :
\n number of items to replace is not a multiple of replacement length\n"
attr(,"class")
[1] "dump.frames"