pasteFactors: Paste two factor vectors

View source: R/factor_ops.R

pasteFactorsR Documentation

Paste two factor vectors

Description

Paste two factors and re-assign the levels

Usage

pasteFactors(x, y, collapse = "_")

Arguments

x, y

Factor vectors

collapse

A character string to separate the x and y.

Value

A new factor vector

Examples

x <- factor(c(rep("A", 10), rep("B", 10)), levels = c("A", "B"))
y <- factor(c(rep("a", 5), rep("b", 15)), levels = c("a", "b"))
pasteFactors(x, y)


easy.utils documentation built on April 4, 2025, 6:13 a.m.