rank.integer64: Sample Ranks from integer64

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Returns the sample ranks of the values in a vector. Ties (i.e., equal values) are averaged and missing values propagated.

Usage

1
2
	## S3 method for class 'integer64'
rank(x, method = NULL, ...)

Arguments

x

a integer64 vector

method

NULL for automatic method selection or a suitable low-level method, see details

...

ignored

Details

This function automatically chooses from several low-level functions considering the size of x and the availability of a cache. Suitable methods are sortorderrnk (fast ordering) and orderrnk (memory saving ordering).

Value

A numeric vector of the same length as x.

Author(s)

Jens Oehlschlägel <Jens.Oehlschlaegel@truecluster.com>

See Also

order.integer64, rank and prank for percent rank.

Examples

1
2
3
4
5
x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE))
rank.integer64(x)

stopifnot(identical(rank.integer64(x),  rank(as.integer(x)
, na.last="keep", ties.method = "average")))

Example output

Loading required package: bit
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit

Attaching package: 'bit'

The following object is masked from 'package:base':

    xor

Attaching package bit64
package:bit64 (c) 2011-2012 Jens Oehlschlaegel
creators: integer64 seq :
coercion: as.integer64 as.vector as.logical as.integer as.double as.character as.bin
logical operator: ! & | xor != == < <= >= >
arithmetic operator: + - * / %/% %% ^
math: sign abs sqrt log log2 log10
math: floor ceiling trunc round
querying: is.integer64 is.vector [is.atomic} [length] format print str
values: is.na is.nan is.finite is.infinite
aggregation: any all min max range sum prod
cumulation: diff cummin cummax cumsum cumprod
access: length<- [ [<- [[ [[<-
combine: c rep cbind rbind as.data.frame
WARNING don't use as subscripts
WARNING semantics differ from integer
for more help type ?bit64

Attaching package: 'bit64'

The following object is masked from 'package:bit':

    still.identical

The following objects are masked from 'package:base':

    %in%, :, is.double, match, order, rank

 [1] 17.0   NA  9.0 11.5   NA  3.0   NA 14.0 14.0   NA   NA   NA  5.5   NA  5.5
[16]   NA   NA  9.0  9.0  5.5   NA  5.5  2.0   NA 11.5 14.0   NA   NA  1.0 17.0
[31] 17.0   NA

bit64 documentation built on May 2, 2019, 4:49 p.m.