### Function Reference: `grp2idx`

statistics: [g, gn, gl] = grp2idx (s)

Get index for group variables.

For variable s, returns the indices g, into the variable groups gn and gl. The first has a string representation of the groups while the later has its actual values. The group indices are allocated in order of appearance in s.

NaNs and empty strings in s appear as NaN in g and are not present on either gn and gl.

See also: grpstats

Source Code: grp2idx