R/cat.to.list.R

"cat.to.list" <-

function(x, a)



{



	a <- as.character(a)



	label <- unique(a)



	out <- as.list(1.:length(label))



	names(out) <- label



	for(k in 1.:length(label)) {



		out[[k]] <- x[label[k] == a]



	}



	out



}

Try the Rlab package in your browser

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

Rlab documentation built on May 5, 2022, 1:05 a.m.