R/bertin.order.R

#$HeadURL: file:///srv/svn/bertin/pkg/bertin/R/bertin.order.R $
#$Id: bertin.order.R 41 2011-09-22 17:45:04Z gsawitzki $
#$Revision: 41 $
#$Date: 2011-09-22 19:45:04 +0200 (Thu, 22 Sep 2011) $
#$Author: gsawitzki $

#! or ordercor() ? see bertin.R
bertin.order <-
function (z, MARGIN=1, pivot=1, FUN=cor)
{
if (MARGIN==1)
{ dist <- vector(mode="numeric", length=nrow(z) )
for (i in (1: nrow(z))){
	dist[i] <- FUN(z[pivot,],z[i,])
}
} else {
dist <- vector(mode="numeric", length=ncol(z) )
for (i in (1: ncol(z))){
	dist[i] <- FUN(z[,pivot],z[,i])
}
}
order(dist)
}

Try the bertin package in your browser

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

bertin documentation built on May 2, 2019, 5:54 p.m.