Closed ethanbsmith closed 3 years ago
This appears fixed in 4b981487d534cef9ff471e203ae80f11e2cd6b8e.
R> TTR::runMedian(c(NA, 2), n = 1, cumulative = FALSE)
[1] NA 2
R> TTR::runMedian(c(NA, 2), n = 1, cumulative = TRUE)
[1] NA 2
Please reopen if it does not fix your actual use case.
Description
I'm not sure if this is a bug or not. It seems an arguable case
runMedian
producesNA
output for the firstn
values in a series, if any of then
values isNA
This is also inconsistent with otherrunXXX
functionsExpected behavior
since
runMedian
considers the median of a single input value to be that value itself,runMedian
should produce a value based on the available non-NA inputs. I think these should produce identical resultsMinimal, reproducible example
Session Info