R/utils-vectors.R

Defines functions collapse

collapse<-function(vect){
	oldClass<-class(vect)
	factorized<-factor(vect)
	newFactor<-factor(.Call(Cpp_icosa_Collapse_, factorized))
	levels(newFactor)<-levels(factorized)
	newVect<-as.character(newFactor)
	class(newVect) <- oldClass
	return(newVect)
}

Try the icosa package in your browser

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

icosa documentation built on March 31, 2023, 8:33 p.m.