Learn R Programming

soc.ca (version 0.8.1)

indicator: Indicator matrix

Description

Creates an indicator matrix from a data.frame with the categories of the questions as columns and individuals as rows.

Usage

indicator(x, id = NULL, ps = ": ")

Value

Returns a indicator matrix

Arguments

x

a data.frame of factors

id

a vector defining the labels for the individuals. If id = NULL row number is used.

ps

the seperator used in the creation of the names of the columns.

See Also

soc.mca

Examples

Run this code
a  <- rep(c("A","B"), 5) 
b  <- rep(c("C", "D"), 5)
x  <- data.frame(a, b)
indicator(x)

Run the code above in your browser using DataLab