Learn R Programming

BNPdensity (version 2019.7.9)

censor_code_rl: Censor code right-left

Description

Creates censoring code 0:3.

Usage

censor_code_rl(left, right)

Arguments

Details

For internal use

Examples

Run this code
# NOT RUN {
## The function is currently defined as
function (left, right) 
{
    test_ = function(k) {
        if (is.na(left[[k]]) & is.na(right[[k]])) 
            NA
        else if (is.na(left[[k]])) 
            2
        else if (is.na(right[[k]])) 
            0
        else if (left[[k]] == right[[k]]) 
            1
        else 3
    }
    sapply(seq_along(left), FUN = test_)
  }
# }

Run the code above in your browser using DataLab