R/pairup.R

Defines functions pairup

Documented in pairup

pairup=function(x,type="less") {
  x=as.matrix(x)
  n=dim(x)[1]
  i=rep(1:n,rep(n,n))
  j=rep(1:n,n)
  c1=apply(x,2,function(y){rep(y,rep(length(y),length(y)))})
  c2=apply(x,2,function(y){rep(y,length(y))})
  ans=cbind(c1,c2)
  ans=switch(type, less=ans[(i<j), ], leq=ans[i<=j, ], neq=ans)
  ans
}

Try the Rfit package in your browser

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

Rfit documentation built on Sept. 8, 2023, 5:59 p.m.