which.dummy {dummies}R Documentation

Identify which columns are dummy variables on a data frame.

Description

Given a data frame and an optional variable name, which.dummy identifies which colummns are dummy variables by the column index.

Usage

which.dummy(data, name=NULL)

Arguments

data An object with a 'dummies' attribute
name Optional. The name of a column that has been expanded to a dummy variable.

Details

Given a data frame and an optional variable name, returns the indices of the dummy columns.

Requires an dummies attribute, usually created by dummy.data.frame.

Value

integer vector of column indices corresponding to the dummy variable(s)

Author(s)

Christopher Brown

See Also

dummy.data.frame, dummy

Examples

  data(iris)
  dat <- dummy.data.frame(iris)
  which.dummy(dat)

[Package dummies version 1.05-1 Index]