R/splitit.R

#' split it
#' 
#' Creates an list of indexes for each unique entry of \code{x}
#' 
#' @param x a vector
#' 
#' @examples
#' x <- c("a","a","b","a","b","c","b","b")
#' splitit(x)
splitit <- function(x) split(seq(along=x),x)

Try the rafalib package in your browser

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

rafalib documentation built on May 1, 2019, 10:26 p.m.