Skip to content

median(NA_integer64_) returns now NA_integer64_#186

Merged
MichaelChirico merged 6 commits intor-lib:mainfrom
ben-schwen:main
Oct 29, 2025
Merged

median(NA_integer64_) returns now NA_integer64_#186
MichaelChirico merged 6 commits intor-lib:mainfrom
ben-schwen:main

Conversation

@ben-schwen
Copy link
Copy Markdown
Contributor

Closes #185

Also removes old stub code branch since dependency of R >= 3.4.0

@ben-schwen
Copy link
Copy Markdown
Contributor Author

pinging @MichaelChirico since I don't know if you have notifications activated for this pkg

@MichaelChirico
Copy link
Copy Markdown
Collaborator

Would you mind fixing this too while we're at it?

median(integer64())
# [1] 9218868437227407266
median(integer())
# [1] NA

Strangely it doesn't match:

median(NA_integer64_, na.rm=TRUE)
# integer64
# [1] <NA>

Comment thread R/highlevel64.R Outdated
Comment thread NEWS.md Outdated
@MichaelChirico
Copy link
Copy Markdown
Collaborator

9218868437227407266 is of course NA_real_ btw:

dput(unclass(as.integer64('9218868437227407266')))
# NA_real_

@MichaelChirico MichaelChirico merged commit 60929f1 into r-lib:main Oct 29, 2025
10 checks passed
@MichaelChirico
Copy link
Copy Markdown
Collaborator

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

median does not work with NAs and na.rm=FALSE

2 participants