powered by
switch
vmap(EXPR, ..., SIMPLIFY = TRUE)
TRUE
x <- c("normal","normal","error","unknown","unknown") vmap(x, normal = 0, error = -1, unknown = -2) x <- c(1,1,2,1,2,2,1,1,2) vmap(x, "type-A", "type-B")
Run the code above in your browser using DataLab