[Rd] version comparison puzzle
Ben Bolker
bbolker at gmail.com
Thu Oct 3 05:41:02 CEST 2013
Can anyone explain what I'm missing here?
max(pp1 <- package_version(c("0.99999911.3","1.0.4","1.0.5")))
## [1] ‘1.0.4’
max(pp2 <- package_version(c("1.0.3","1.0.4","1.0.5")))
## [1] ‘1.0.5’
I've looked at ?package_version , to no avail.
Since max() goes to .Primitive("max")
I'm having trouble figuring out where it goes from there:
I **think** this is related to ?xtfrm , which goes to
.encode_numeric_version, which is doing something I really
don't understand (it's in base/R/version.R ...)
.encode_numeric_version(pp1)
## [1] 1 1 1
## attr(,"base")
## [1] 99999912
## attr(,"lens")
## [1] 3 3 3
## attr(,".classes")
## [1] "package_version" "numeric_version"
.encode_numeric_version(pp2)
## [1] 1.083333 1.111111 1.138889
## attr(,"base")
## [1] 6
## attr(,"lens")
## [1] 3 3 3
## attr(,".classes")
## [1] "package_version" "numeric_version"
sessionInfo()
R Under development (unstable) (2013-09-09 r63889)
Platform: i686-pc-linux-gnu (32-bit)
[snip]
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.1.0 tools_3.1.0
More information about the R-devel
mailing list