read_selected_omx: Read a OMX matrix based on a lookup vector

View source: R/lookup.R

read_selected_omxR Documentation

Read a OMX matrix based on a lookup vector

Description

This function reads a portion of an OMX matrix using selection statements to define the portion.

Usage

read_selected_omx(
  file,
  matrix_name,
  row_selection = NULL,
  col_selection = NULL,
  row_labels = NULL,
  col_labels = NULL
)

Arguments

file

Path name of the OMX file where the lookup resides.

matrix_name

Name of the matrix in the OMX file.

row_selection

Row selection statement or vector of row selection statements (see Details).

col_selection

Column selection statement or vector of column selection statements (see Details).

row_labels

Name of lookup to use for labeling rows.

col_labels

Name of lookup to use for labeling columns

Details

Multiple selection selection statements can be used for each dimension. Each selection statement is a logical expression represented in a double-quoted string. The left operand is the name of a lookup vector The operator can be any logical operator including the value or values to check against. This can be the name of a vector defined in the calling environment. If the right operand contains literal string values, those values must be single-quoted. Multiple selection conditions may be used as argument by including in a vector. Multiple selection conditions are treated as intersections.

Value

An R matrix object representing the selected rows and colums.

Examples

omxfile <- omxr_example("skims.omx")
read_selected_omx(
  omxfile, "DIST", row_selection = 'EI == "Ext"' 
)


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