Closed jwbowers closed 7 years ago
I think this warning may be flagging a bug. It's being thrown at this line of makedist.R, i.e.
res <- replace(within, 1:length(within), dists)
In the provided example, I get
Browse[1]> length(within)
[1] 4889857
Browse[1]> length(dists)
[1] 22887076
Browse[1]> length(dists)/length(within)
[1] 4.680521
so something's gone wrong. Barring an explanation as to why this should be innocuous, I'm flagging this as a bug.
Additional comments:
exactMatch()
part of the example doesn't itself generate warnings. makedist
was mostly in Mark's court. Could you both take a look, share your thoughts about what's supposed to be going on vs what is?Update: the problem is specific to the rank_mahalanobis
method, which appears to be generating distances of incorrect length.
> em1 <- exactMatch(a24~region+genderMale,data=psdat)
> mhDist <- match_on(mhfmla, within=em1, data=psdat, method="rank_mahalanobis")
Warning message:
In replace(within, 1:length(within), dists) :
number of items to replace is not a multiple of replacement length
> mhDist <- match_on(mhfmla, within=em1, data=psdat, method="mahalanobis")
>
The resolution of the issue appears to be that this particular warning should have been an error. Hopefully to stop being an error soon -- see #128 . Closing.
On one particular analysis I'm running into this warning (from
makedist
). And I haven't figured it out. Any ideas? (Code to replicate below)Code
Output