make01MemberMatrix: Creates a matrix indicating membership in a group based on a...

Description Usage Arguments Value

Description

Membership is assumed to be described by a set of integers stored in the variable.

Usage

1
make01MemberMatrix(pInDT, pPrefix)

Arguments

pInDT

a data.table with two columns: SID and some integer variable

pPrefix

a string indicating the prefix to give to each category-specific column of the output

Value

A data.table with the same two columns as the input DT, plus k new columns, one for each unique category (i.e. value) in the 2nd column of pInDT. Let 'str' be the value of 'pPrefix'; and suppose the categories are numbered 1, 2, ... then the columns will have the names str1, str2, etc.


johninpdx/RSTools documentation built on May 19, 2019, 5:15 p.m.