# --- Example 1: Using the default formula list format ---
# This is the recommended and default usage.
mapping_formula <- list(
c(0, 1, 3) ~ "Neutrophil",
c(2, 4, 8) ~ "Macrophage"
)
finsert(mapping_formula)
# --- Example 2: Using the expression format for backward compatibility ---
mapping_expr <- expression(
c(0, 1, 3) == "Neutrophil",
c(2, 4, 8) == "Macrophage"
)
finsert(mapping_expr, len = 10, na = "Unassigned")
Run the code above in your browser using DataLab