-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I'm confused by what na.rm = TRUE is supposed to do in roll_median:
library(RcppRoll)
x <- 1:20
x[3:4] <- NA
x
roll_medianr(x = x,n = 5,na.rm = TRUE)
[1] NA NA NA NA 2 2 NA NA 7 8 9 10 11 12 13 14 15 16 17 18
roll_maxr(x = x,n = 5,na.rm = TRUE)
[1] NA NA NA NA 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Why is the median in position 6 equal to 2 rather than 3.5? Why are there NAs positions 7 and 8?
Am I missing something obvious or is this a bug?
Metadata
Metadata
Assignees
Labels
No labels