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

Add .simplify argument to accumulate() and accumulate2() #782

Closed

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Aug 5, 2020

Because the original implementation was based on Reduce() we've accidentally implemented the original accumulate() function with automatic simplification. I think ideally accumulate() should always return a list and simplification would be achieved by piping into simplify(). However that would probably be too large a breaking change. Instead, accumulate() now has a .simplify argument to optionally disable simplification.

accumulate2() gains this argument as well. The default is set to TRUE even though it didn't use to automatically simplify. This is because consistency with accumulate() seems more important. This is a behaviour change but I don't see any use of accumulate2() on CRAN. Closes #774.

@lionel- lionel- added the advice label Aug 5, 2020
@hadley
Copy link
Member

hadley commented Aug 24, 2022

Also fixes #809

@hadley
Copy link
Member

hadley commented Aug 27, 2022

Should we allow a .ptype here?

@lionel-
Copy link
Member Author

lionel- commented Sep 7, 2022

Closing in favour of #909.

@lionel- lionel- closed this Sep 7, 2022
@lionel- lionel- deleted the fix-accumulate-simplification-default branch September 7, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: accumulate2 returns a list, not a vector
2 participants