CombineCollinearRowsCols {TaxicabCA}R Documentation

Removes rows and columns of zeros and optionnally, row or column duplicates

Description

Removes rows and columns of zeros and optionnally, row or column duplicates

Usage

CombineCollinearRowsCols(Y, rows = F, cols = F)

Arguments

Y

A matrix or an object that can be coerced to a matrix

rows

Logical: Will duplicate rows be removed?

cols

Logical: Will duplicate columns be removed?

Details

Rows and columns of zeros will be removed.

A matrix of zeros will be returned as matrix with 0 row and 0 column.

If rows 1,2,3 are combined, the name of row 1 is kept. Similarly for columns.

Value

A matrix with rows and columns removed as requested

Examples

CombineCollinearRowsCols(matrix(1:3,nrow=3,ncol=2),cols=TRUE)

CombineCollinearRowsCols(cbind(matrix(1:3,nrow=3,ncol=2),rep(0,3)),cols=TRUE)

CombineCollinearRowsCols(cbind(matrix(1:3,nrow=3,ncol=2),rep(0,3)))

CombineCollinearRowsCols(matrix(0,nrow=3,ncol=3))

CombineCollinearRowsCols(rodent,TRUE,FALSE)


[Package TaxicabCA version 0.1.1 Index]