Learn R Programming

ltmle (version 0.9-5)

BinaryToCensoring: BinaryToCensoring

Description

Helper function for creating censoring columns as factors.

Usage

BinaryToCensoring(is.censored, is.uncensored)

Arguments

is.censored
binary vector: 0=uncensored, 1=censored
is.uncensored
binary vector: 0=censored, 1=uncensored

Value

  • an object of class "factor" with levels "censored" and "uncensored"

Details

Exactly one of is.censored and is.uncensored must be specified as a named argument. All elements of the input vector must be 0, 1, or NA

See Also

factor

Examples

Run this code
BinaryToCensoring(is.censored=c(0, 1, 1, 0, NA))
 BinaryToCensoring(is.uncensored=c(1, 0, 0, 1, NA))   #the same
 
 BinaryToCensoring(c(0, 1))   #error because the input must be named

Run the code above in your browser using DataLab