plotROC (version 2.2.1)

verify_d: Check that D is suitable for using as binary disease status

Description

Checks for two classes and gives a warning message indicating which level is assumed to be 0/1. Throws an error if more than two levels appear in D.

Usage

verify_d(D)

Arguments

D

Vector that will be checked for 2-class labels

Value

A vector the same length as D that takes values 0, indicating no disease or 1 indicating disease.

Examples

Run this code
# NOT RUN {
verify_d(c(1, 0, 1))
# }
# NOT RUN {
verify_d(c(TRUE, FALSE, TRUE)) #warning
verify_d(c("Dead", "Alive", "Dead")) #warning
verify_d(c("Disease", "Healthy", "Missing")) #error
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace