Skip to content

version 1.0.0 cummean() function is providing weird results #5287

Description

@nsingh-phd

For testing, I have this small vector x where the long(er) way is giving me the results as expected version 1.0.0 cummean() is not.

library(tidyverse)
x <- 1:5

# long(er) way
cumsum(x) / seq_along(x)
#> [1] 1.0 1.5 2.0 2.5 3.0

# dplyr 0.8.5 cummean()
cummean(x)
#> [1] 1.0 1.5 2.0 2.5 3.0

# dplyr 1.0.0 cummean()
cummean(x)
#> [1] 1.000000 1.000000 1.333333 1.750000 2.200000

Created on 2020-05-31 by the reprex package (v0.3.0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorfuns 😆wipwork in progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions