covCreate: Extract Unique Levels from Combined Covariates

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

This function creates a single variable with a set of unique levels based on a set of covariates, the number of all possible combinations for each of the covariates

Usage

1
covCreate(mat)

Arguments

mat

a matrix of the covariates of interest.

Value

Returns a vector indicating the corresponding combination of levels for each observation.

Examples

1
2
3
# Create an example matrix of covariates with differing levels
mat = cbind( rep( c(0,1), 3 ), rep( c(0,1,0), each = 2 ) )
ex = covCreate( mat ); print( ex )

rettopnivek/utilityf documentation built on March 1, 2021, 7:05 p.m.