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

dplyr::cummean unexpected results #1387

Closed
reinholdsson opened this issue Sep 5, 2015 · 0 comments
Closed

dplyr::cummean unexpected results #1387

reinholdsson opened this issue Sep 5, 2015 · 0 comments

Comments

@reinholdsson
Copy link

@reinholdsson reinholdsson commented Sep 5, 2015

I get unexpected results when using dplyr::cummean, see the following example:

a <- rep(99, 9)
a == dplyr::cummean(a)
# [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE
as.integer(dplyr::cummean(a))
# [1] 99 99 99 99 99 99 98 98 98

with base R:

a == base::cumsum(a)/1:length(a)
# [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

I'm using the latest version of dplyr from github (master branch).

@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant