# {resp, noresp} --> {0, 1} vector resp01 <- c(apply( data.frame(resp, noresp), 1, function(x) c(rep(1, x[1]), rep(0, x[2])) ))
resp01 <- rep(c(1, 0), c(resp, noresp))