R/make.consecutive.int.r

Defines functions make.consecutive.int

Documented in make.consecutive.int

make.consecutive.int <- function(y) {
	intialwarn = getOption("warn")
	options(warn = -1)
	if(is.null(y)) {return(NULL)}  
	if(!is.vector(y)){
		y = as.vector(as.character(y))
	}
	out <- as.integer(as.factor(as.character(y)))-1  
	options(warn = intialwarn)
	return(out)
}

Try the ktspair package in your browser

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

ktspair documentation built on May 2, 2019, 3:25 a.m.