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

summarise on Date column: min with na.rm=TRUE returns wrong value #755

Closed
alexploner opened this issue Nov 7, 2014 · 0 comments
Closed

summarise on Date column: min with na.rm=TRUE returns wrong value #755

alexploner opened this issue Nov 7, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@alexploner
Copy link

@alexploner alexploner commented Nov 7, 2014

Unexpected behaviour when summarising a Date-variable using min (or max) under R 3.1.1, dplyr 0.3.0.2, Windows 7:

dates = as.Date(c("2014-01-01", "2013-01-01"))
dd = data.frame(Dates = dates)

Summarizing works fine:

require(dplyr)
summarise(dd, min(Dates))
##  min(Dates)
##1 2013-01-01

... except if I set add.rm=TRUE:

summarise(dd, min(Dates, na.rm=TRUE))
##  min(Dates, na.rm = TRUE)
##1               1970-01-01

Some implicit type conversion along the way?

@romainfrancois romainfrancois added this to the 0.3.1 milestone Nov 7, 2014
@romainfrancois romainfrancois self-assigned this Nov 7, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants