maybe warn when weights and n differ and weights wins?
greg-minshall opened this issue · 0 comments
greg-minshall commented
hi. thanks very much for RcppRoll. but... :)
i find the following behavior odd
`
require(RcppRoll)
Loading required package: RcppRoll
roll_sum(1:9, n=2)
[1] 3 5 7 9 11 13 15 17
roll_sum(1:9, weights=1, n=2)
[1] 1 2 3 4 5 6 7 8 9
roll_sum(1:9, weights=c(1,1), n=2)
[1] 3 5 7 9 11 13 15 17
`
i would have expected weights
to have been recycled, but, if i understand the code correctly, n is forced to the length of weights (if they are specified). i wonder if you might think of generating a warning message in this case? i certainly spent time scratching my head puzzling over this.
cheers!