Learn R Programming

healthcareai (version 1.2.4)

isTargetYN: Tests whether predictedCol is Y/N. Allows for NAs to be present.

Description

Returns a logical, TRUE or FALSE, depending on what is contained in the vector. If any NAs are present in the vector, they will be removed later on in development with removeRowsWithNAInSpecCol.

Usage

isTargetYN(x)

Arguments

x

A data frame column, matrix column, or vector

Value

A boolean

References

http://healthcareai-r.readthedocs.io

See Also

healthcareai

Examples

Run this code
# NOT RUN {
dat <- data.frame(a = c(0,1,1,0,0,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0))
dat2 <- data.frame(a = c(3, 4, 5, 6, 7, 8, 9))
dat3 <- data.frame(a = c('Y', 'N', 'Y', 'N'))
dat4 <- data.frame(a = c('Y', 'N', 'Y', 'N', NA))
isTargetYN(dat[, 1])
isTargetYN(dat2[, 1])
isTargetYN(dat3[, 1])
isTargetYN(dat4[, 1])

# }

Run the code above in your browser using DataLab