R/classToInd.R

classToInd <- function(x){
	
	count.vec <- vector()
	for (i in 1:nrow(x)){
		tmp <- rep(x[i,1], x[i,2])
		count.vec <- c(count.vec, tmp)
	}
	ind.table <- cbind(c(1:length(count.vec)), count.vec)
	colnames(ind.table) <- c("ID", "No.Obs")
	return(ind.table)
	
}

Try the capwire package in your browser

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

capwire documentation built on May 2, 2019, 9:45 a.m.