Learn R Programming

ltmle (version 1.3-0)

BinaryToCensoring: BinaryToCensoring

Description

Helper function for creating censoring columns as factors.

Usage

BinaryToCensoring(is.censored, is.uncensored)

Value

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

Arguments

is.censored

binary vector: 0=uncensored, 1=censored

is.uncensored

binary vector: 0=censored, 1=uncensored

Author

Joshua Schwab jschwab77@berkeley.edu

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

Examples

Run this code

 BinaryToCensoring(is.censored=c(0, 1, 1, 0, NA))
 BinaryToCensoring(is.uncensored=c(1, 0, 0, 1, NA))   #the same
 
 if (FALSE) {
 BinaryToCensoring(c(0, 1))   #error because the input must be named
 }

Run the code above in your browser using DataLab