R/reassignLabels.R

reassignLabels <-
function (x, pars)
{
	labels = unique (x)
	nlabels = length (labels)
	x.new = x
	pars.new = matrix (0, nrow=nlabels, ncol=ncol(pars))

	for (i in 1:nlabels)
	{
		x.new[which (x==labels[i])] = i
		pars.new[i,] = pars[labels[i],]
	}
	
	return (list (c=x.new, pars=pars.new))
}

Try the DIRECT package in your browser

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

DIRECT documentation built on Sept. 8, 2023, 5:45 p.m.