Skip to content

maybe warn when weights and n differ and weights wins? #39

@greg-minshall

Description

@greg-minshall

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions