expandFrame {anacor}R Documentation

Converts Table to Indicator Matrix

Description

This utility function expands a matrix or data frame to an indicator supermatrix and optionally converts this to a data frame again. By default NA becomes zero and constant rows and columns are eliminated.

Usage

expandFrame(tab, clean = TRUE, zero = TRUE, returnFrame = TRUE)

Arguments

tab Data frame of dimension n times m with frequencies. Missings are coded as NA.
clean If TRUE, rows and colums with 0 margins in data frame are deleted.
zero If TRUE, NA's are replaced by 0.
returnFrame If TRUE, a data frame is returned; if FALSE a matrix.

See Also

burtTable, mkIndiList

Examples


## Indicator matrix for tocher data
data(tocher) 
expandFrame(tocher)


[Package anacor version 0.9-8 Index]