R/nth.R

Defines functions nth colnth rownth

Documented in colnth nth rownth

#[export]
rownth <- function(x,elems,num.of.nths=1,descending=FALSE,na.rm = FALSE,index.return = FALSE,parallel = FALSE,cores = 0) {
	if(parallel){
		.Call(Rfast_row_nth_p,x,elems,descending,na.rm,index.return,cores)
	}else{
  		.Call(Rfast_row_nth,x,elems,num.of.nths,descending,na.rm,index.return)
	}
}

#[export]
colnth <- function(x,elems,num.of.nths=1,descending=FALSE,na.rm = FALSE,index.return = FALSE,parallel = FALSE,cores = 0) {
	if(parallel){
  		.Call(Rfast_col_nth_p,x,elems,descending,na.rm,index.return,cores)
	}else{
		.Call(Rfast_col_nth,x,elems,num.of.nths,descending,na.rm,index.return)
	}
}

#[export]
nth <- function(x,k,num.of.nths=1,descending=FALSE,index.return=FALSE,na.rm = FALSE) {
	if(is.integer(x)){
		.Call(Rfast_nth_int,x,k)
	}else{
  		.Call(Rfast_nth,x,k,num.of.nths,descending,na.rm,index.return)
  	}
}

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.