fac2seg function

Factor to Segments

Factor to Segments

fac2seg(fac)

Arguments

  • fac: A factor where each level represents a segment

Returns

A list of vectors, each vector contains the indices of the elements of the corresponding segment

Examples

fac <- factor(c("a", "b", "a", "b", "c", "c")) fac2seg(fac)
  • Maintainer: Kristian Hovde Liland
  • License: GPL-2
  • Last published: 2024-09-15