View source: R/censor_code_rl.R
censor_code_rl | R Documentation |
Creates censoring code 0:3.
censor_code_rl(left, right)
For internal use
## 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_)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.