R/normalizeProbMtx.R

Defines functions normalizeProbMtx

normalizeProbMtx <-
function (mtx, direc)
{
	margin.sum = as.vector (apply (mtx, direc, sum))
	if (direc==1)
	{
		result = mtx / margin.sum
	}
	if (direc==2)
	{
		result = t(t(mtx)/margin.sum)
	}
	return (result)
}

Try the DIRECT package in your browser

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

DIRECT documentation built on May 29, 2017, 10:59 a.m.