R/Order.R

Defines functions colOrder rowOrder Order

Documented in colOrder Order rowOrder

#[export]
Order<-function(x,stable=FALSE,descending=FALSE,partial=NULL,parallel=FALSE){
	if(is.character(x)){
		x <- as.numeric(x)
	}
	if(is.null(partial)){
		.Call(Rfast_Order,x,stable,descending,parallel)
	}else{
		.Call(Rfast_partial_sort_index,x,partial,descending,parallel)
	}
}

#[export]
rowOrder <- function(x,stable=FALSE,descending=FALSE,parallel=FALSE,cores = 0) {
  if(parallel){
  	.Call(Rfast_row_order_p,x,stable,descending,cores)
  }else{
  	.Call(Rfast_row_order,x,stable,descending)
  }
}

#[export]
colOrder <- function(x,stable=FALSE,descending=FALSE,parallel=FALSE,cores = 0) {
  if(parallel){
  	.Call(Rfast_col_order_p,x,stable,descending,cores)
  }else{
  	.Call(Rfast_col_order,x,stable,descending)
  }
}

Try the Rfast package in your browser

Any scripts or data that you put into this service are public.

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.