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

shadow_shift where there is no variance #37

Closed
njtierney opened this issue Dec 31, 2016 · 1 comment
Closed

shadow_shift where there is no variance #37

njtierney opened this issue Dec 31, 2016 · 1 comment
Labels

Comments

@njtierney
Copy link
Owner

njtierney commented Dec 31, 2016

Previously in #36 I worked out how to handle cases where there is only one complete value.

Now I need to work out a way to handle cases where there is no variance

library(naniar)

shadow_shift(c(NA,4,4))
#> [1] 4 4 4

It performs find when there is some small variance

shadow_shift(c(NA,4,3))
#> [1] 2.884298 4.000000 3.000000
shadow_shift(c(NA,4,NA))
#> [1] 3.424959 4.000000 3.457942
@njtierney
Copy link
Owner Author

This now works!

library(narnia)

shadow_shift(c(NA,4,4))
#> [1] 3.740455 4.000000 4.000000
shadow_shift(c(NA,4,3))
#> [1] 2.881757 4.000000 3.000000
shadow_shift(c(NA,4,NA))
#> [1] 3.731255 4.000000 3.506998

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

No branches or pull requests

1 participant