cf: Construct a 'factor' from one or more vectors

View source: R/mapping.R

cfR Documentation

Construct a factor from one or more vectors

Description

A factor is constructed from one or more atomic vectors. If more than one atomic vector is supplied, then a compound value is constructed by concatenating the values together. The order of the levels is the natural order in which the values appear.

Usage

cf(x, ..., sep = ";")

Arguments

x

An atomic vector.

...

Additional atomic vectors (optional).

sep

A character to use as a separator when forming a compound value (default ';').

Value

A factor.

Examples

x <- c("A", "B", "A")
y <- c(2, 5, 7)
cf(x, y)
mapping(cf(x, y), c("X", "Y", "Z"))

benjaminrich/mappings documentation built on June 23, 2024, 1:23 a.m.