# omxSelectRows

## omxSelectRows

### Description

The function omxSelectRows filters columns from an mxMatrix using a single row or column R matrix as a selector. The function omxSelectCols can be used to only filter columns and the function omxSelectRowsAndCols can be used to filter rows or columns.

### Usage

• omxSelectRowsAndCols(mxMatrixToBeFiltered, selectorMatrix)
• omxSelectRows(mxMatrixToBeFiltered, selectorMatrix)
• omxSelectCols(mxMatrixToBeFiltered, selectorMatrix)

### Arguments

• mxMatrixToBeFiltered - A mxMatrix
• selectorMatrix - A single row or single column R matrix indicating which values should be filtered from the mxMatrix.

### Details

omxSelectRowsAndCols, omxSelectRows, and omxSelectCols returns the filtered entries in a mxMatrix specified by a single row or single column selector matrix. Each entry in the selector matrix is treated as a logical data indicating if the corresponding entry in the mxMatrix should be excluded (0 or FALSE) or included (not 0 or TRUE). Typically the function is used to filter data from an mxMatrix using an existence vector which specifies what data entries are missing. This can be seen in the demo: FIMLRowObjectiveBivariateCorrelation.R.

### Value

Returns a new MxMatrix object with the filtered data.

### References

The function is most often used when filtering data for missingness. This can be seen in the demo: FIMLRowObjectiveBivariateCorrelation.R. The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation. The omxSelect* functions share some similarity to the Extract function in the R programming language.

### Examples

loadings <- c(1, -0.625, 0.1953125, 1, -0.375, 0.0703125, 1, -0.375, 0.0703125)
cols <- omxSelectCols(loadingsMatrix, existenceList)