reduceMatNew {apComplex}R Documentation

Remove matrix columns

Description

This function eliminates columns that are identically equal to or strictly less than other columns in a matrix. This is an alternate version of reduceMat. It allows a distinction between previously reduced columns of a matrix and new columns that have not yet been reduced.

Usage

reduceMatNew(mat, newvec, compare = "equal")

Arguments

mat mat is a matrix.
newvec newvec is a vector with length equal to the number of columns of mat. newvec contains a 1 for new column and 0 for a previously reduced column. The order of the entries in newvec should correspond to the columns of mat.
compare compare is a character equal to "equal" (default) or "less".

Details

If compare is set to "equal", then all new columns, indicated in newvec, which are identically equal to another column in the previously reduced columns of mat are removed from the matrix.

If compare is set to "less", then a new column is removed from the matrix if all of its entries are less than all entries of another column in the matrix.

Value

A matrix with columns eliminated according to the criteria specified in compare.

Author(s)

Denise Scholtens

See Also

reduceMat,vecInMat,whichVecInMat

Examples

a <- matrix(c(1,0,1,1,1,0,1,0,1,1,0,0),nrow=3)
reduceMatNew(a,newvec=c(0,0,1,1))
reduceMatNew(a,newvec=c(0,0,1,1),compare="less")


[Package apComplex version 1.0.1 Index]