Function prank.integer64
projects the values [min..max]
via ranks
[1..n]
to [0..1]
.
qtile.integer64()
is the inverse function of 'prank.integer64' and
projects [0..1]
to [min..max]
.
Details
Function prank.integer64
is based on rank.integer64()
.
See also
rank.integer64()
for simple ranks and qtile()
for the
inverse function quantiles.
Examples
x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE))
prank(x)
#> [1] 0.07894737 0.92105263 NA 0.65789474 NA 0.92105263
#> [7] NA NA NA NA 0.34210526 0.65789474
#> [13] 0.26315789 0.07894737 0.47368421 0.65789474 0.47368421 NA
#> [19] NA 0.21052632 0.65789474 0.07894737 0.92105263 NA
#> [25] 0.92105263 NA 0.07894737 0.47368421 NA 0.34210526
#> [31] NA 0.78947368
x <- x[!is.na(x)]
stopifnot(identical(x, unname(qtile(x, probs=prank(x)))))