indmat function

Create an Indicator Matrix

Create an Indicator Matrix

Creates an indicator matrix from a grouping vector.

indmat(grp.vec, K = length(unique(grp.vec)))

Arguments

  • grp.vec: Numeric vector giving the group membership.
  • K: Scalar indicating the number of groups. Defaults to the number of unique elements in grp.vec.
  • Maintainer: Pieter Schoonees
  • License: GPL (>= 2)
  • Last published: 2016-01-05

Useful links