Closed HenrikBengtsson closed 6 years ago
This bug occurred with TopDom 0.0.1:
> x <- double(4L)
> TopDom::legacy("0.0.1")$Detect.Local.Extreme(x)
Error in if (x[cp$cp[i]] >= x[cp$cp[i] - 1] && x[cp$cp[i]] >= x[cp$cp[i] + :
missing value where TRUE/FALSE needed
but was fixed in TopDom 0.0.2:
> TopDom::legacy("0.0.2")$Detect.Local.Extreme(x)
[1] 0 0 0 0
The fix was:
> diffobj::diffDeparse(TopDom::legacy("0.0.2")$Detect.Local.Extreme, TopDom::legacy("0.0.1")$Detect.Local.Extreme)
< TopDom::legacy("0.0.2")$Detect.Local.Extreme
> TopDom::legacy("0.0.1")$Detect.Local.Extreme
@@ 14,6 / 14,4 @@
if (length(cp$cp) <= 2)
return(ret)
< if (length(cp$cp) == n_bins)
< return(ret)
for (i in 2:(length(cp$cp) - 1)) {
if (x[cp$cp[i]] >= x[cp$cp[i] - 1] && x[cp$cp[i]] >=
This is now also fixed in the TopDom package:
> TopDom:::Detect.Local.Extreme(x)
[1] 0 0 0 0
(There was a thinko in the TopDom package causing it to implement the TopDom 0.0.1 version rather than the TopDom 0.0.2 version)
This happened with real data:
Debugging
TopDom()
reveals that: