R/flattenCellIndices.R

Defines functions flattenCellIndices

#------------------------------
# FLATTENING OF CELLS
#------------------------------

flattenCellIndices <- function(cells) {

	## Flatten cell data and clean the names
	cells <- unlist(cells)						
	names(cells) <- gsub("[.](groups|indices.*)", "", names(cells))
	unitNames <- gsub("[.].*", "", names(cells))				
	groupNames <- gsub(".*[.]", "", names(cells))
	groupNames <- paste(unitNames, groupNames, sep=".")

	return(data.frame(unitNames=unitNames, groupNames=groupNames, cell=cells))	

}

Try the PECA package in your browser

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

PECA documentation built on Nov. 8, 2020, 7:24 p.m.