Learn R Programming

c2c (version 0.1.0)

labels_to_matrix: 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

Run this code
# NOT RUN {
my_labels <- rep(c("a","b","c","d"), 5)
labels_to_matrix(my_labels)

# }

Run the code above in your browser using DataLab