labels_to_matrix: Make a vector of class labels into a hard binary matrix

Description Usage Arguments Value Examples

Description

Used in get_conf_mat but might be useful separately

Usage

1

Arguments

x

Character or factor vector of class labels

Value

Binary matrix of class membership.

Examples

1
2
my_labels <- rep(c("a","b","c","d"), 5)
labels_to_matrix(my_labels)

c2c documentation built on May 1, 2019, 10:13 p.m.