Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
greg-minshall opened this issue May 20, 2020 · 0 comments
Open

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

greg-minshall opened this issue May 20, 2020 · 0 comments

Comments

@greg-minshall
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant