dummy {rigr}R Documentation

Create Dummy Variables

Description

Create Dummy Variables

Usage

dummy(
  x,
  subset = rep(TRUE, length(x)),
  reference = sort(unique(x[!is.na(x)])),
  includeAll = FALSE
)

Arguments

x

y variable used to create the dummy variables.

subset

cluster a subset of the data, if desired.

reference

the reference value for the dummy variables to compare to.

includeAll

logical value indicating whether all of the dummy variables should be returned (including the reference).

Value

A matrix containing the dummy variables.

Examples


data(mri)

# Create a dummy variable for chd
dummy(mri$chd)


[Package rigr version 1.0.4 Index]