matrix.subset: Preserve matrix formatting when reformatting a matrix

Description Usage Arguments

Description

When a single column is extracted from a multicolumn matrix, R often strips the matrix formatting. This generally causes my code to crash, because I assume that the formatting is preserved. This function aims to preserve that formatting. Testing note: Tested with an input matrix with 5 columns & 4 rows, and subset to obtain 0, 1 and 2 columns.

Usage

1
matrix.subset(in.mat, index.var, target.value)

Arguments

in.mat

The input matrix

index.var

The variable to be used for subsetting

target.value

The value of the subsetting variable to subset on.


akeyel/myr documentation built on May 12, 2019, 4:41 a.m.