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

.fill in stretch_dbl #88

Closed
opoyc opened this issue Feb 14, 2019 · 2 comments
Closed

.fill in stretch_dbl #88

opoyc opened this issue Feb 14, 2019 · 2 comments
Labels
feature new functions or arguments

Comments

@opoyc
Copy link

opoyc commented Feb 14, 2019

Having a tsibble, after creating a new variable with mutate, slice_dbl appends NA values to match the original number of rows, whereas stretch does not for .size=1.

x <- 1:10
slide_dbl(.x = x, .f = ~mean(.), .size = 2, .fill = NA)
stretch_dbl(.x = x, .f = ~mean(.), .init = 2, .fill = NA)

Am I missing something?

Nice package BTW!

@earowang earowang added the feature new functions or arguments label Feb 14, 2019
@earowang
Copy link
Member

The reason why no .fill in the stretch(), bc I'm not sure how to fill NA when the incrementing size is > 1. But I think I could add NA in the beginning of the each window size. I'll add .fill = NA for the v0.7.0 release. Thanks.

@earowang
Copy link
Member

Now stretch() gains a new argument .fill = NA to ensure the output of the same length as the input. But I renamed the argument .size to .step.

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

No branches or pull requests

2 participants