numMat: Create a Numeric Matrix from a List of Values

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Create a numeric matrix from a list of values

Usage

1
numMat(listOfValues, fill = NA, mode = "binary")

Arguments

listOfValues

A list of input values to be inserted in a matrix.

fill

The initializing fill value for the empty matrix.

mode

Either "binary" or "value". Defaults to "binary".

Details

This is primarily a helper function for the concat.split() function when creating the "expanded" structure. The input is anticipated to be a list of values obtained using base::strsplit().

Value

A matrix.

Author(s)

Ananda Mahto

See Also

base::strsplit(), charMat().

Examples

1
2
3
4
5
6
invec <- c("1,2,4,5,6", "1,2,4,5,6", "1,2,4,5,6",
           "1,2,4,5,6", "-1,1,2,5,6", "1,2,5,6")
A <- strsplit(invec, ",")
splitstackshape:::numMat(A)
splitstackshape:::numMat(A, fill = 0)
splitstackshape:::numMat(A, mode = "value")

splitstackshape documentation built on May 1, 2019, 8:20 p.m.