Factor to Segments
fac2seg(fac)
fac
A list of vectors, each vector contains the indices of the elements of the corresponding segment
fac <- factor(c("a", "b", "a", "b", "c", "c")) fac2seg(fac)
Useful links