rthorder: Parallel Order and Rank

Description Usage Arguments Value Examples

View source: R/rthorder.R

Description

Similar to R's order() and rank().

Usage

1

Arguments

x

A numeric vector.

rnk

Logical; if TRUE, the result is like a call to R's rank(); if FALSE, it is like R's order().

nthreads

An optional argument for specifying the number of threads (in the case of OpenMP or TBB backends) that the routine should (at most) use. Does nothing with a CUDA backend. See nthreads.

Value

Vector of indices for either order or rank operation..

Examples

1
2
3
4
5
6
7
8
## Not run: 
x <- c(1.2,0.3,0.8,2.8)
order(x)  # prints 2,3,1,4
rthorder(x)  # same
rank(x)  # prints 3,1,2,4
rthorder(x,rnk=TRUE)  # same

## End(Not run)

matloff/Rth documentation built on May 21, 2019, 12:55 p.m.