labels_to_matrix {c2c}R Documentation

Make a vector of class labels into a hard binary matrix

Description

Used in get_conf_mat but might be useful separately

Usage

labels_to_matrix(x)

Arguments

x

Character or factor vector of class labels

Value

Binary matrix of class membership.

Examples

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


[Package c2c version 0.1.0 Index]