# NOT RUN {
contrib <- c(-1, 0, 0, 1)
contrib0 <- c(FALSE, FALSE, TRUE, FALSE)
contribCodes <- recode2(contrib>0, contrib0,
c('returned', 'received', '0', 'ERR') )
cC <- c('returned', 'returned', '0', 'received')
# }
# NOT RUN {
all.equal(contribCodes, cC)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab