charMat: Create a Binary Matrix from a List of Character Values

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

Description

Create a binary matrix from a list of character values

Usage

1
charMat(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(), numMat().

Examples

1
2
3
4
5
invec <- c("rock,electro","electro","rock,jazz")
A <- strsplit(invec, ",")
splitstackshape:::charMat(A)
splitstackshape:::charMat(A, 0)
splitstackshape:::charMat(A, mode = "value")

mrdwab/splitstackshape documentation built on May 23, 2019, 7:16 a.m.