R/ord.R

ord <-
function(X){

if (is.vector(X)==TRUE){
	A=sort(X,method="sh",index.return=TRUE)$x
	a=sort(X,method="sh",index.return=TRUE)$ix
}
if (is.vector(X)==FALSE){
	A=matrix(,nrow(X),ncol(X))
	a=matrix(,nrow(X),ncol(X))
	for (j in 1:ncol(X)){ 
		A[,j]=sort(X[,j],method="sh",index.return=TRUE)$x
		a[,j]=sort(X[,j],method="sh",index.return=TRUE)$ix
	}
}
out=list()
out$A=A
out$a=a
return(out)
}

Try the ThreeWay package in your browser

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

ThreeWay documentation built on May 2, 2019, 9:20 a.m.