indmat: Create an Indicator Matrix

View source: R/indmat.R

indmatR Documentation

Create an Indicator Matrix

Description

Creates an indicator matrix from a grouping vector.

Usage

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.


cds documentation built on April 16, 2025, 1:10 a.m.