Learn R Programming

dummies (version 1.05-1)

get.dummy: Get the dummy variable columns from a data frame.

Description

Given a data.frame and an optional variables name, return only the columns that are dummy variables

Usage

get.dummy(data, name = NULL)

Arguments

data
A data.frame with an dummies attributes
name
Optional. The name of a variable.

Value

  • The subset of data that are dummy columns.

Details

This uses which.dummy to identify the dummy columns.

See Also

which.dummy, dummy.data.frame

Examples

Run this code
data( iris ) 
    d <- dummy.data.frame( iris )
    get.dummy( d, 'Species' )

Run the code above in your browser using DataLab