# NOT RUN {
# Set up vector
v1 <- c("A", "B", "C", "B")
# Define format
fmt1 <- value(condition(x == "A", "Label A"),
condition(x == "B", "Label B"),
condition(TRUE, "Other"))
# Apply format to vector
v2 <- fapply(v1, fmt1)
v2
# }
Run the code above in your browser using DataLab