R/orth.R

orth <-
function(A){

svd=svd(A)
m=nrow(A)
n=ncol(A)
if (m>1){
	s=svd$d
} else{ 
	if (m==1){
		s=svd$d[1]
		} else{
		s==0
	}
}
eps=1.0e-016
tol=max(m,n)*max(s)*eps
r=sum(s>tol)
Q=svd$u[,1:r]
return(Q)
}

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.