read_omx: Read an OMX matrix

View source: R/read_write_omx.R

read_omxR Documentation

Read an OMX matrix

Description

This function reads an entire matrix in an OMX file or portions of a matrix using indexing.

Usage

read_omx(file, name, row_index = NULL, col_index = NULL)

Arguments

file

Path name of the OMX file where the matrix resides.

name

Name of the matrix in the OMX file

row_index

An integer vector indicating the rows represented by matrix. Defaults to NULL, meaning that all rows are read (and nrow(matrix) is the number of rows in the matrix).

col_index

The precise corrolary to row_index, for columns.

Value

An R matrix object containing the named data from the OMX file

Examples

omxfile <- omxr_example("skims.omx")
mat <- read_omx(omxfile, "DIST")
str(mat)
read_omx(omxfile, "DIST", c(1,4,5), c(1,4,5))


gregmacfarlane/omxr documentation built on May 7, 2022, 11:42 a.m.